I noticed that the tutorial on here adds a marker to google maps and zooms on it. How exactly do I go about making it so when the mapview is initiated it zooms in on the users location instead?
Edit: forgot to add my code, but this should zoom on the users location, right?
Edit: forgot to add my code, but this should zoom on the users location, right?
B4X:
Sub Map_Ready
mylocation.Initialize(lat,lng)
lng = mylocation.Longitude
lat = mylocation.Latitude
Log("map ready")
gmap = mFragment.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
gmap.MyLocationEnabled = True
Dim cp As CameraPosition
cp.Initialize(lat, lng, gmap.CameraPosition.Zoom)
gmap.AnimateCamera(cp)
End If
End Sub
Last edited: