Sub gmap_Ready
btnResetMap.Enabled = True
btnJumpToEiffel.Enabled = True
Log("map ready")
'Create BTSMarker Options including ICON
Private BTSOptions As MarkerOptions
Private BitmapDescriptor1 As BitmapDescriptor
Private BitmapDescriptorFactory1 As BitmapDescriptorFactory
BTSOptions.Initialize
BTSOptions.Draggable(True)
BTSOptions.Position2(BTSLat, BTSLng).Snippet("").Title("BASE")
BTSOptions.Anchor(0.5, 0.5)
BitmapDescriptor1=BitmapDescriptorFactory1.FromAsset("markerghost.png")
BTSOptions.Icon(BitmapDescriptor1)
'Create BTSmarker
BTSMarker=GoogleMapsExtras1.AddMarker(gmap, BTSOptions)
'Create LANDMarker Options including ICON
Private LANDOptions As MarkerOptions
Private BitmapDescriptor2 As BitmapDescriptor
Private BitmapDescriptorFactory2 As BitmapDescriptorFactory
LANDOptions.Initialize
LANDOptions.Draggable(True)
LANDOptions.Position2(LANDLat, LANDLng).Snippet("").Title("LANDMARK")
LANDOptions.Anchor(0.5, 0.5)
BitmapDescriptor2=BitmapDescriptorFactory2.FromAsset("markerghost.png")
LANDOptions.Icon(BitmapDescriptor2)
'Creat LANDMarker marker
LANDMarker =GoogleMapsExtras1.AddMarker(gmap, LANDOptions)
Private AnyDragListener As OnMarkerDragListener
AnyDragListener.Initialize("AnyDragListener")
GoogleMapsExtras1.SetOnMarkerDragListener(gmap,AnyDragListener)
HorizonPointLatLng
DrawLandMarkLine
DrawAntBearingLine
cp.Initialize(MapLat, MapLng, MapZoom )
gmap.MoveCamera(cp)
gmap.maptype = MapTypeInt 'MapTypeInt: 1=Road Map, 2=Satellite, 3=Terrain, 4=Satellite with Labels
End Sub
Sub AnyDragListener_Drag(Marker1 As Marker)
Projection1=GoogleMapsExtras1.GetProjection(gmap)
MarkerLocation = gmap.get Marker1.Position
MarkerLocation = Marker1.Position
ScreenPosition = Projection1.toScreenLocation(MarkerLocation)
XX = ScreenPosition.X
YY = ScreenPosition.Y
If Marker1 = BTSMarker Then
'Find Screen X&Y of Marker
BTSX = XX
BTSY = YY
'Move Imageview to Marker Screen position
BTSIV.Left = BTSX - BTSIV.Width/2
BTSIV.Top = (BTSY - BTSIV.Height/2) + pnlDispLatLng.Height
Private BTSLatLng As LatLng
BTSLatLng = BTSMarker.Position
BTSLat = BTSLatLng.Latitude
BTSLng = BTSLatLng.Longitude
Private LandMarkLatLng As LatLng
LandMarkLatLng = LANDMarker.Position
LANDLat = LandMarkLatLng.Latitude
LANDLng = LandMarkLatLng.Longitude
HorizonPointLatLng
DrawLandMarkLine
DrawAntBearingLine
Else
LMX = XX
LMY = YY
LMIV.Left = LMX - LMIV.Width/2
LMIV.Top = (LMY - LMIV.Height/2) + pnlDispLatLng.Height
Private BTSLatLng As LatLng
BTSLatLng = BTSMarker.Position
BTSLat = BTSLatLng.Latitude
BTSLng = BTSLatLng.Longitude
Private LandMarkLatLng As LatLng
LandMarkLatLng = LANDMarker.Position
LANDLat = LandMarkLatLng.Latitude
LANDLng = LandMarkLatLng.Longitude
DrawLandMarkLine
End If
DispBTSLat.Text = NumberFormat2 (BTSLat, 1 , 5, 5, False)
DispBTSLng.Text = NumberFormat2 (BTSLng, 1 , 5, 5, False)
DispLandLat.Text = NumberFormat2 (LANDLat, 1 , 5, 5, False)
DispLandLng.Text = NumberFormat2 (LANDLng, 1 , 5, 5, False)
DispAntBearing.Text = NumberFormat2 (AntBearing, 1 , 1 , 1, False)
End Sub