Can you give the updated GoogleMapsExtras a test?
A new method:
SetOnMyLocationChangeListener (GoogleMap1
As GoogleMap, OnMyLocationChangeListener1
As OnMyLocationChangeListener)
Sets a callback that's invoked when the my location dot changes location.
To unset the callback use Null.
and a new listener object:
OnMyLocationChangeListener
Events:
- MyLocationChange (Location1 As Location)
Methods:
- Initialize (EventName As String)
- IsInitialized As Boolean
Basic syntax:
Dim OnMyLocationChangeListener1 As OnMyLocationChangeListener
OnMyLocationChangeListener1.Initialize("OnMyLocationChangeListener1")
GoogleMapsExtras1.SetOnMyLocationChangeListener(GoogleMap1, OnMyLocationChangeListener1)
' and a Sub
Sub OnMyLocationChangeListener1_MyLocationChange(Location1 As Location)
' handle the location change here
End Sub
Until the deprecated method and listener are removed from the API they are at least there to use if you want.
The new Location API from Google is an attempt to create better ways for the developer to get the device location, the Location API also introduces new Geofence and Activity Detection functionality.
So the existing b4a libraries that enable getting the device location will continue to function.
And the new LocationAPI library will co-exist with Google's
promise of easier, more battery friendly ways to get the device location.
Whether the new LocationAPI offers any real world benefits over the older methods only time will tell.
So if you can test the update and post with your results - i shall then properly upload the update in the correct thread.
Martin.