Sub gmap_MarkerClick (SelectedMarker As Marker)
MarkerFlag = markerMap.Get(SelectedMarker)
' Log (MarkerFlag)
MapZoom = gmap.CameraPosition.Zoom
MapCenter = gmap.CameraPosition.Target
MapLat = MapCenter.Latitude
MapLng = MapCenter.Longitude
If MarkerFlag =1 Then
'Remove BTS marker before replacing marker icon
BTSMarker.Remove
MarkerLocation.Initialize(BTSLat,BTSLng)
BTSMarker = gmap.AddMarker2(10 , 10, "BASE", File.GetUri(File.DirAssets, "bts2.png"))
BTSMarker.Position = MarkerLocation 'set BTSMarker new location
markerMap.Put(BTSMarker, 1)
LANDMarker.Remove
MarkerLocation.Initialize(LANDLat,LANDLng)
LANDMarker = gmap.AddMarker2(LANDLat , LANDLng, "LANDMARK", File.GetUri(File.DirAssets, "landmark2.png"))
LANDMarker.Position = MarkerLocation 'set LANDMarker new location
markerMap.Put(LANDMarker, 2) 'place them both in a Map so you can retrieve Marker1's location (MarkerLocation)
Else
LANDMarker.Remove
MarkerLocation.Initialize(LANDLat,LANDLng)
LANDMarker = gmap.AddMarker2(LANDLat , LANDLng, "LANDMARK", File.GetUri(File.DirAssets, "landmark3.png"))
LANDMarker.Position = MarkerLocation 'set LANDMarker new location
markerMap.Put(LANDMarker, 2) 'place them both in a Map so you can retrieve Marker1's location (MarkerLocation)
BTSMarker.Remove
MarkerLocation.Initialize(BTSLat,BTSLng)
BTSMarker = gmap.AddMarker2(10 , 10, "BASE", File.GetUri(File.DirAssets, "bts1.png"))
BTSMarker.Position = MarkerLocation 'set BTSMarker new location
markerMap.Put(BTSMarker, 1)
End If
'Force re-draw of map to remove old marker icon
RefreshScreen
End Sub