Gps - Updating location on map while user moving in Android

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

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

Answers

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.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/9870059/updating-location-on-map-while-user-moving-in-android

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils