I am trying to make the Google Map camera/rotation face North when the user is moving/driving.
I am using the following code but the camera doesn't move.
B4X:
Sub SetBearing(bearing As Double)
Dim currentCamera As CameraPosition = B4XPages.MainPage.P_Map.gmap.CameraPosition
Dim newCamera As CameraPosition
newCamera.Initialize2(currentCamera.Target.Latitude, currentCamera.Target.Longitude, currentCamera.Zoom, bearing, currentCamera.Tilt)
B4XPages.MainPage.P_Map.gmap.AnimateCamera(newCamera)
End Sub
B4X:
Public Sub LocationChanged(Location1 As Location)
If Location1.BearingValid Then LastLocation = Location1
If Location1.BearingValid Then SetBearing(Location1.Bearing)
End Sub
Basically I'm trying to replicate what Google Map looks like while you're navigating, but I would like to do so without navigation
Also side question but related, is there something I can use to emulate driving so I don't have to go out for a drive to test? lol
Hi to everybody I would like to display the map having the gps movement direction always pointing to the top of the screen, like navigation apps do. I guess that it is necessary to rotate the map (or the camera,for me not very clear at the moment). Thanks in advance