Hello, I thought I had fixed my issue but no :/
I had a little gmap field which working, but now I would like to put the map on full screen. When I tried to do it everything stop working :/
My old code just load my gmap, but don't recreate my journey
this is my old code
I had a little gmap field which working, but now I would like to put the map on full screen. When I tried to do it everything stop working :/
My old code just load my gmap, but don't recreate my journey
B4X:
Sub Globals
Private show_map As MapFragment
Private shared As String
Private gmap As GoogleMap
end sub
Sub gps_design_activity
show_map.Initialize("show_map", panel_map)
Do Until show_map.GetMap.IsInitialized
Sleep(300)
Loop
If show_map.GetMap.IsInitialized Then
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_COARSE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
gmap = show_map.GetMap
gmap.MyLocationEnabled = True
End If
If show_map.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Google Play services not available.", True)
End If
If gmap.IsInitialized Then
If File.ExternalWritable = False Then
Msgbox("No rights to write"," ")
Return
Else
shared = Starter.rp.GetSafeDirDefaultExternal("GPS_Location")
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE)
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult(Permission As String, Result As Boolean)
If Result Then SaveStringExample
End If
'--Method
Dim pl As Polyline = gmap.AddPolyline
Dim lat_lng As String
Dim lat, lng As Double
Dim Points As List
Points.Initialize
CallSub(Starter, "StopGPS")
For k = 1 To lmaps.Size - 1
lat_lng = lmaps.Get(k)
lat = lat_lng.SubString2(10, lat_lng.IndexOf(","))
lng = lat_lng.SubString2(lat_lng.IndexOf(",") + 12, lat_lng.IndexOf2(",",lat_lng.IndexOf(",") +1))
Dim ll As LatLng
ll.Initialize(lat, lng)
Points.add(ll)
Next
pl.Points = Points
pl.Color = Colors.Blue
pl.ZIndex=3
Dim cp As CameraPosition = gmap.CameraPosition
#if debug
Log(cp)
#end if
Dim NewCP As CameraPosition
NewCP.Initialize(lat, lng, cp.Zoom + 14)
gmap.AnimateCamera(NewCP)
Else
Log("Gmap not initialize")
End If
End Sub
Sub SaveStringExample
Dim su As StringUtils
If File.Exists(shared,"GPS_Pos_CSV_" & InfoActivity.activity_name & "_" & InfoActivity.activity_id & ".csv") Then
Log("File exist")
If Starter.gmaps.Size < 1 Then
Dim Items() As String
'Items.Initialize
For Each Row() As String In su.LoadCSV (shared,"GPS_Pos_CSV_" & InfoActivity.activity_name & "_" & InfoActivity.activity_id & ".csv",",")
For Each n As String In Row
Items = Regex.Split(";", N)
maps.Initialize
'maps.Put("Altitude", Items(0))
maps.Put("Latitude", Items(1))
maps.Put("Longitude", Items(2))
maps.Put("TimeStamp", Items(3))
lmaps.Add(maps)
Next
Next
End If
Else
End If
'Log(lmaps)
End Sub