Sub MapFragment1_Ready
Sleep(500)
Log("MapFragment1_Ready")
Log(MapFragment1.GetOpenSourceLicenseInfo)
gmap = MapFragment1.GetMap
gmap.MapType = gmap.MAP_TYPE_NORMAL
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
End If
Try
If GPSModule.Location.EqualsIgnoreCase("") Then
GetMapByAddress(JobMain.JobAddress)
Dim m2 As Marker = gmap.AddMarker(GPSModule.latitude,GPSModule.longitude, "You Are Here")
m2.Snippet = "Current Location"
Else
Log("get map failed")
End If
Catch
Log("ERROR" & LastException.Message)
End Try
End Sub
Sub Activity_Resume
'MapFragment1.Initialize("Map", MapPanel)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub GetMapByAddress (aDD As String)
Dim gg As Geocoder
gg.Initialize("gg")
gg.GetFromLocationName(aDD,5,Null)
End Sub
Sub gg_GeocodeDone(Results() As Location, Tag As Object)
xfs.WriteTextWriterDim("gg_GeocodeDone")
If Results.Length > 0 Then
Dim Location1 As Location
Dim i As Int
For i=0 To Results.Length-1
Location1=Results(i)
cpLat = Location1.Latitude
cpLong = Location1.Longitude
Next
Log("Try")
Dim m1 As Marker = gmap.AddMarker(cpLat, cpLong, JobMain.JobAddress)
m1.Snippet = Main.jobs.record.TransID
Else
ToastMessageShow("Location not found!", False)
End If
cp.Initialize(cpLat, cpLong, 15)
gmap.AnimateCamera(cp)
End Sub