liangzi7 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

How can I get location updates via MyLocationOverlay #506

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using the MyLoctionOverlay (newest osmdroid)

Is it possible to get location updates (every 5 secondes e.g.)? 
E.g. Can I register Location updates in the program ... and does this not have 
a negative effect on the MyLocationManager? 

So e.g. locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
            3000, 0, gpsLocationListener);

I don't want to interfere with the location updates the MyLocationOverlay needs 
to redraw the location etc. 

I know there is also a MyLocationOverlay.onLocationChanged(). Can I use that 
one? Via inheriting? 

Original issue reported on code.google.com by janvdijs...@gmail.com on 26 Dec 2013 at 7:15

GoogleCodeExporter commented 9 years ago
Hello - I believe I have answered your question on SO: 
http://stackoverflow.com/questions/20825077/android-get-location-updates-without
-interfering-with-osmdroid-mylocatoinoverla

But to summarize - you can add multiple listeners to Android's location manager 
without them interfering or you can override the onLocationChanged() event (as 
long as you call through to super).

Original comment by kurtzm...@gmail.com on 31 Dec 2013 at 7:50

GoogleCodeExporter commented 9 years ago
This was answered and accepted at SO.

Original comment by kurtzm...@gmail.com on 7 Jan 2014 at 3:04