Hello!
I'm using GoogleMaps & GoogleMapsExtras libraries as part of an app for an electric vehicle. Therefore i draw a light green circle around the current position with radius=remaining range/autonomie of the car, a second darker circle with radius=half autonomie and a red dot for the car itself.
GPS lat & GPS lon is used via a timer with 1000msec to update the map.
Since i know no sub similiar RemoveCircle i have to build the map from stratch every second. So it's blinking on drawing the green circles. That's not so nice viewing.
The other problem is if i have a lot of POIs the device can't follow with the updates in 1000msec, because the POIs are also generated in this update-sub.
Is there a RemoveCircle available or another solution dealing with this?
...
gmap.Clear
Try
cur = SQL1.ExecQuery("SELECT * FROM POIS;")
If cur.RowCount > 0 Then
For i = 0 To cur.RowCount - 1
cur.Position = i
sGPS_Lat = cur.GetString2(0)
sGPS_Lon = cur.GetString2(1)
sName = cur.GetString2(2)
sDesc = cur.GetString2(3)
gmap.AddMarker(sGPS_Lat, sGPS_Lon, sName)
Next
End If
cur.Close
Catch
End Try
coRemainingRange.Initialize
coRemainingRange.Center2(scanner.Gps_Lat, scanner.Gps_Lon).FillColor(Colors.ARGB(50,0,255,51)).Radius(scanner.autonomie * 1000).StrokeColor(Colors.Black).StrokeWidth(0)
cRemainingRange = gmape.AddCircle(gmap, coRemainingRange)
coRemainingRange.Center2(scanner.Gps_Lat, scanner.Gps_Lon).FillColor(Colors.ARGB(60,0,255,51)).Radius(scanner.autonomie * 1000 / 2).StrokeColor(Colors.Black).StrokeWidth(0)
cRemainingRange = gmape.AddCircle(gmap, coRemainingRange)
coRemainingRange.Center2(scanner.Gps_Lat, scanner.Gps_Lon).FillColor(Colors.Red).Radius(dRadius).StrokeColor(Colors.Black).StrokeWidth(0)
cRemainingRange = gmape.AddCircle(gmap, coRemainingRange)
cpRemainingRange.Initialize(scanner.Gps_Lat, scanner.Gps_Lon, iZoomLevel)
gmap.AnimateCamera(cpRemainingRange)
...
Martin
I'm using GoogleMaps & GoogleMapsExtras libraries as part of an app for an electric vehicle. Therefore i draw a light green circle around the current position with radius=remaining range/autonomie of the car, a second darker circle with radius=half autonomie and a red dot for the car itself.
GPS lat & GPS lon is used via a timer with 1000msec to update the map.
Since i know no sub similiar RemoveCircle i have to build the map from stratch every second. So it's blinking on drawing the green circles. That's not so nice viewing.
The other problem is if i have a lot of POIs the device can't follow with the updates in 1000msec, because the POIs are also generated in this update-sub.
Is there a RemoveCircle available or another solution dealing with this?
...
gmap.Clear
Try
cur = SQL1.ExecQuery("SELECT * FROM POIS;")
If cur.RowCount > 0 Then
For i = 0 To cur.RowCount - 1
cur.Position = i
sGPS_Lat = cur.GetString2(0)
sGPS_Lon = cur.GetString2(1)
sName = cur.GetString2(2)
sDesc = cur.GetString2(3)
gmap.AddMarker(sGPS_Lat, sGPS_Lon, sName)
Next
End If
cur.Close
Catch
End Try
coRemainingRange.Initialize
coRemainingRange.Center2(scanner.Gps_Lat, scanner.Gps_Lon).FillColor(Colors.ARGB(50,0,255,51)).Radius(scanner.autonomie * 1000).StrokeColor(Colors.Black).StrokeWidth(0)
cRemainingRange = gmape.AddCircle(gmap, coRemainingRange)
coRemainingRange.Center2(scanner.Gps_Lat, scanner.Gps_Lon).FillColor(Colors.ARGB(60,0,255,51)).Radius(scanner.autonomie * 1000 / 2).StrokeColor(Colors.Black).StrokeWidth(0)
cRemainingRange = gmape.AddCircle(gmap, coRemainingRange)
coRemainingRange.Center2(scanner.Gps_Lat, scanner.Gps_Lon).FillColor(Colors.Red).Radius(dRadius).StrokeColor(Colors.Black).StrokeWidth(0)
cRemainingRange = gmape.AddCircle(gmap, coRemainingRange)
cpRemainingRange.Initialize(scanner.Gps_Lat, scanner.Gps_Lon, iZoomLevel)
gmap.AnimateCamera(cpRemainingRange)
...
Martin