Sub Process_Globals
Private rp As RuntimePermissions
End Sub
Sub Globals
Private gmap As GoogleMap, frag As MapFragment, marc As Marker, pos As CameraPosition
Dim CenterLat, CenterLong As Float
Dim pnlAB As Panel
Dim Title As Label
Dim Menu As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("gmap")
Menu.Visible=False
End Sub
Sub ShowMap(coordinates() As Float, name As String)
Title.Text=name
Title.TextSize=Starter.TextSize
CenterLat=coordinates(0)
CenterLong=coordinates(1)
If frag.IsGooglePlayServicesAvailable = False Then Return
' For Each permission As String In Array(rp.PERMISSION_ACCESS_FINE_LOCATION)
' rp.CheckAndRequest(permission)
' Wait For Activity_PermissionResult (permission As String, Result As Boolean)
' If Result = False Then
' ToastMessageShow("No permission!", True)
' Activity.Finish
' Return
' Else
' gmap.MyLocationEnabled=True
' End If
' Next
End Sub
Sub frag_Ready
gmap = frag.GetMap
pos.Initialize(CenterLat, CenterLong, 10)
gmap.MoveCamera(pos)
If marc.IsInitialized Then marc.Remove
marc = gmap.AddMarker2(pos.Target.Latitude, pos.Target.Longitude, Activity.Title, gmap.HUE_GREEN)
End Sub