I'm not sure that I understand. The GetBearing method cannot help you if you are using GoogleMaps library. You can however manually rotate the map according to the bearing.
I found in the meantime, that "BearingTo" function is also available in GPS library. So i use the Location-Object to do this now - it's working perfect!
B4X:
Sub MapsGps_LocationChanged(lCurrent As Location) ' is also called by MapsTest2
...
'Bearing: 0° = north on top, 90° = east on top, 180° = south on top, 270° = west on top
dMapsGpsBearing = lMapsGpsLast.BearingTo(lMapsGpsCurrent)
If dMapsGpsBearing < 0 Then
dMapsGpsBearing = dMapsGpsBearing + 360
End If
'Log("dMapsGpsBearing=" & dMapsGpsBearing)
UpdatePanelMaps(False, False)
...
End Sub
B4X:
Sub UpdatePanelMaps(bFirstCall As Boolean, bPOIsLoaded As Boolean)
...
cpAutonomie.Initialize2(lMapsGpsCurrent.Latitude, lMapsGpsCurrent.Longitude, iMapsGpsZoomLevel, dMapsGpsBearing, 0)
...
End Sub
But the general question is: how can i define an object from a special library, if two (or more) libraries uses the same typedef? If i define an object from type "Marker". But "Marker" is defined in library GoogelMaps & OSMDroid.
I'm not sure that I understand. The GetBearing method cannot help you if you are using GoogleMaps library. You can however manually rotate the map according to the bearing.