Android Question Google Map Mapfragment not showing map

DaniloArg

Member
My problem is when I start the activity for the first time it does not show the map, but if I leave and enter again it does show it. Does something take a time to load? Why do that? Here the code

Sub Activity_Create(FirstTime As Boolean)

Wait For MapFragment1_Ready
gmap = MapFragment1.GetMap
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)

If Result Then
gmap.MyLocationEnabled = True
Else
Log("No permission!")
End If

If MapFragment1.GetMap.IsInitialized Then
gmap = MapFragment1.GetMap
gmap.MyLocationEnabled = True
Dim cp As CameraPosition
cp.Initialize(-35.998437,-65.083404,5)
gmap.MoveCamera(cp)

Else
'something
End If

end sub

Please help. TKS
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

Don't use activities. Switch to B4XPages.

 
Upvote 0
Top