Sub t1_tick
'If the GPS position is available, show in the map where i'm located, else it show a toast message acquiring position.
If GoogleMap1.MyLocation.IsInitialized=True Then
T1.Enabled=False
ToastMessageShow("inicializado", False)
Label1.Text= GoogleMap1.MyLocation.Latitude
Label2.Text= GoogleMap1.MyLocation.Longitude
'--------Geocoder ------------------------------------------------------------------------
Dim MaxResults As Int
MaxResults=5
geocoder1.GetFromLocation(GoogleMap1.MyLocation.Latitude, GoogleMap1.MyLocation.Longitude, MaxResults, Null)
'--------------------------------------------------------------------------------------------
Dim MarkerOptions1 As MarkerOptions
MarkerOptions1.Initialize
MarkerOptions1.Position2(GoogleMap1.MyLocation.Latitude, GoogleMap1.MyLocation.Longitude).Snippet("Home is where the heart is").Title("Home Sweet Home").Visible(True)
Dim BitmapDescriptor1 As BitmapDescriptor
Dim BitmapDescriptorFactory1 As BitmapDescriptorFactory
BitmapDescriptor1=BitmapDescriptorFactory1.FromAsset("ht1.2.png")
MarkerOptions1.Icon(BitmapDescriptor1)
Marker_usr=GoogleMapsExtras1.AddMarker(GoogleMap1, MarkerOptions1)
Marker_usr.Draggable=True
Dim OnMarkerDragListener1 As OnMarkerDragListener
OnMarkerDragListener1.Initialize("OnMarkerDragListener1")
If OnMarkerDragListener1.IsInitialized Then
GoogleMapsExtras1.SetOnMarkerDragListener(GoogleMap1, OnMarkerDragListener1)
Else
Log("OnMarkerDragListener1 is not initialized - check that the Activity contains at least one callback Sub")
End If
'shows where I'm located
Dim CameraPosition2 As CameraPosition
CameraPosition2.Initialize(GoogleMap1.MyLocation.Latitude, GoogleMap1.MyLocation.Longitude, 17)
GoogleMap1.AnimateCamera(CameraPosition2)
Else
ToastMessageShow("Adquiriendo posicion",False)
End If
End Sub