I want a notification when approaching my marker approach to a place the marker radius is 250 meter
The place are actually stored to place.kml and i use already Google maps v2 - GoogleMapsExtras in MapFragment and creating one monitoring geofences
if a good soul can help me !
it's been a week that I am on this problem that I ask questions without having an answer
Sub MapFragment1_Ready
Log("MapFragment1_Ready")
gmap=MapFragment1.GetMap
If gmap.IsInitialized Then
Dim m1 As Marker
m1=gmap.AddMarker(gmap.MyLocation.latitude, gmap.MyLocation.longitude, "toto")
m1.Snippet = "this is toto"
Dim cp As CameraPosition
cp.Initialize(gmap.MyLocation.latitude,gmap.MyLocation.longitude, 18)
gmap.AnimateCamera(cp)
Dim KMLLayer1 As KMLLayer
KMLLayer1.Initialize(gmap, File.OpenInput(File.DirAssets, "place.kml"))
KMLLayer1.AddLayerToMap
If KMLLayer1.HasContainers Then
Dim Containers As List=KMLLayer1.GetContainers
End If
If KMLLayer1.HasPlacemarks Then
Dim Placemarks As List=KMLLayer1.GetPlacemarks
End If
Else
Log("Error initializing GoogleMap")
ToastMessageShow("Error initializing GoogleMap", False)
End If
End Sub
Sub AddGeofence
Dim geo As Geofence
geo.Initialize
geo.Id = "DETECT"
geo.Center.Initialize2(gmap.MyLocation.latitude,gmap.MyLocation.longitude)
geo.RadiusMeters = 100
geo.ExpirationMs = DateTime.TicksPerDay 'expire after one day
CallSubDelayed3(GeofenceService, "AddGeofence", Me, geo)
Wait For Geofence_Added (Success As Boolean)
Log("Geofence added: " & Success)
End Sub
The place are actually stored to place.kml and i use already Google maps v2 - GoogleMapsExtras in MapFragment and creating one monitoring geofences
if a good soul can help me !
it's been a week that I am on this problem that I ask questions without having an answer
Sub MapFragment1_Ready
Log("MapFragment1_Ready")
gmap=MapFragment1.GetMap
If gmap.IsInitialized Then
Dim m1 As Marker
m1=gmap.AddMarker(gmap.MyLocation.latitude, gmap.MyLocation.longitude, "toto")
m1.Snippet = "this is toto"
Dim cp As CameraPosition
cp.Initialize(gmap.MyLocation.latitude,gmap.MyLocation.longitude, 18)
gmap.AnimateCamera(cp)
Dim KMLLayer1 As KMLLayer
KMLLayer1.Initialize(gmap, File.OpenInput(File.DirAssets, "place.kml"))
KMLLayer1.AddLayerToMap
If KMLLayer1.HasContainers Then
Dim Containers As List=KMLLayer1.GetContainers
End If
If KMLLayer1.HasPlacemarks Then
Dim Placemarks As List=KMLLayer1.GetPlacemarks
End If
Else
Log("Error initializing GoogleMap")
ToastMessageShow("Error initializing GoogleMap", False)
End If
End Sub
Sub AddGeofence
Dim geo As Geofence
geo.Initialize
geo.Id = "DETECT"
geo.Center.Initialize2(gmap.MyLocation.latitude,gmap.MyLocation.longitude)
geo.RadiusMeters = 100
geo.ExpirationMs = DateTime.TicksPerDay 'expire after one day
CallSubDelayed3(GeofenceService, "AddGeofence", Me, geo)
Wait For Geofence_Added (Success As Boolean)
Log("Geofence added: " & Success)
End Sub
Last edited: