Android Question Google Maps - Rotate Map according to BEaring

daniedb

Active Member
Licensed User
Longtime User
Hi Guys

Anyone know how to turn the google maps according to a Value (eg bearing), so that I always follow "upwards" or movement always Upwards

Thanks
D
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Something like:
B4X:
Sub SetBearing(bearing As Double)
 Dim currentCamera = gmap.CameraPosition
 Dim newCamera As CameraPosition
 newCamera.Initialize2(currentCamera.Target.Latitude, currentCamera.Target.Longitude, currentCamera.Zoom, bearing, currentCamera.Tilt)
 gmap.AnimateCamera(newCamera)
End Sub
 
Upvote 0

Sidnei Nardo

Member
Licensed User
Longtime User
Hi. I'm developing an application that uses map and location, I could not make the map rotate, to always go up, according to the movement of the smartphone. I believe I have to make it spin automatically, but how do I know what value I should put as a parameter? Do you have any more detailed examples?
Thank you very much.

Texto Original
Ola. Estou desenvolvendo um aplicativo que utiliza mapa e localização, Não consegui fazer o mapa girar, para sempre ir para cima, de acordo com o movimento do smartphone. Acredito que eu tenha que fazer ele girar automático, mas como saber qual valor eu devo colocar como parâmetro? tem algum exemplo mais detalhado?
Muito obrigado.


Sidnei Nardo
 
Upvote 0

wes58

Active Member
Licensed User
Longtime User
Hi. I'm developing an application that uses map and location, I could not make the map rotate, to always go up, according to the movement of the smartphone. I believe I have to make it spin automatically, but how do I know what value I should put as a parameter? Do you have any more detailed examples?
Thank you very much.

Texto Original
Ola. Estou desenvolvendo um aplicativo que utiliza mapa e localização, Não consegui fazer o mapa girar, para sempre ir para cima, de acordo com o movimento do smartphone. Acredito que eu tenha que fazer ele girar automático, mas como saber qual valor eu devo colocar como parâmetro? tem algum exemplo mais detalhado?
Muito obrigado.


Sidnei Nardo
if you have a sub GPS_LocationChanged (currentLocation As Location) in your code, use currentLocation.Bearing as a parameter to the function that Erel posted in above post.
 
Upvote 0
Top