Updating location on map while user moving in Android - android

I am working on a application where I want to show user location when user is moving. I get user location using custom overlay but when user moves marker jumps from one location to another location which I don't want. Marker must move smoothly. Does anyone done this before??
Please give some example code..
Thank You
Edited:--
After using MyLocationOverlay it doesn't solve my problem but when I implemented LocationListener to my activity it solved my problem as now it is more smooth than previous version. I am checking location for 1 micro second & for 0.00001 meters.
Now When marker moves outside the visible area of map it doesn't show the marker so whenever marker moves outside the current visible area of the map activity itself should center of the map to current location (i.e. to the marker location)..
Thank You

If you want your marker moves smoothly then you have to listen the location at very small time .
Means that you have to set the minimum time and minimum distance for location updates to 0.
so when you get the new location you have to update that location on the map so it will work smoothly.

Related

How to move marker like car goes on road on a map?

I want move marker(like car goes on road) smoothly on google map in android my application like jugnoo.
Check out how to receive location updates here
and then update the position of your marker inside onLocationChanged

How do i make a marker show only on road, rather than showing it on houses and buildings?

I have been able to show my current location on the map. I have been able to use the location manager and fused location api to display my current location. Here i am unable to maintain the positioning of the marker in the map, i.e; When ever i move on road just to check the movement of the marker, the marker also moves but some times it goes over houses and buildings. How do i make the marker stay put on road. If you check the Uber app, the car that comes to pick you up always stays on the road it never goes on top of the houses and buildings.
Kindly advice me on how to make the marker move only on the road.
Thanks in advance.
Sidharth

how to update marker's location when is dragged

I have 2 markers one being user's location and the other is a normal draggable marker and i get the distance between them, but no matter where I drag my marker I always get the same distance between them, how can I get an updated location when I drag the marker? Thank you very much
To get the position of the drag marker, you should use an OnMarkerDragListener to listen for drag events on a marker. To set this listener on the map, call GoogleMap.setOnMarkerDragListener.
You can get the position of the marker at any time by calling Marker.getPosition().
Check this issue and SO question for more information.

Delete all but one marker in Android Google Maps V2

So I have some places of interests shown to user via markers with respect to their current location (which is also shown as a blue marker on the map).
What I want, is to sustain the location marker on the map, remove all the other markers, and refresh it after certain conditions are met. I was able to do all that except the sustaining user location marker + overlay circle.
I know that there's map.clear(); function but wouldn't it also clear the current location marker? How to achieve what I want to?
Thanks.

Android map marker smooth movement

I'm doing an android application which involves google map to show smooth location movement.for example,if the user is in driving.,the marker which indicates current position should do smooth move according to the user move.How could i do that.I don't have any idea in this.Help is much appreciated.thanks.

Categories

Resources