Android Question Googlemaps how get Latitude , Longitude from my location

aboalwaleed

Member
Licensed User
Longtime User
On the screen I see my location with a blue circle


But I do not know how to get Latitude , Longitude

149231945641741.png


Because it gives me [ gmap.MyLocation.IsInitialized = False ]


And sometimes they are Tue



B4X:
Sub MapFragment1_Ready
     gmap = MapFragment1.GetMap
    
     If gmap.IsInitialized = False Then
         ToastMessageShow("Error initializing map.", True)
     Else
         Dim cp As CameraPosition
            gmap.MyLocationEnabled = True
            If gmap.MyLocation.IsInitialized Then
                 cp.Initialize(gmap.MyLocation.Latitude, gmap.MyLocation.Longitude, 18)
                gmap.AnimateCamera(cp)
            Label1.Text = gmap.MyLocation.Latitude
            Label2.Text = gmap.MyLocation.Longitude
         End If
     End If
End Sub
 
Top