....
Dim MapPanel As Panel
MapPanel.Initialize("MapPanel")
LayoutPanel.AddView(MapPanel, 0, lbl.Height + 1dip, LayoutPanel.Width, 200dip)
Geocoder1.GetFromLocationName(indirizzo, 1, Null)
....
Sub Geocoder1_GeocodeDone(Results() As Address, Tag As Object)
If Results.Length>0 Then
Dim Address1 As Address
Dim i As Int
For i=0 To Results.Length-1
Address1=Results(i)
toLat = Address1.Latitude
toLon = Address1.Longitude
Next
'Lancio Google Maps dopo aver acquisito le coordinate dall'indirizzo
'Per Google Maps
If MapFragment1.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Please install Google Play Services.", True)
Else
MapFragment1.Initialize("Map", MapPanel)
End If
Else
'Msgbox("Messaggio", "Non è stato inserito alcun indirizzo")
ToastMessageShow("Non è stato inserito alcun indirizzo", True)
End If
End Sub
Sub Map_Ready
Log("map ready")
gmap = MapFragment1.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
'gmap.AddMarker(latitudine, longitudine, "Hello!!!")
Dim cp As CameraPosition
'cp.Initialize(latitudine, longitudine, gmap.CameraPosition.Zoom)
cp.Initialize(toLat, toLon, 17.0)
gmap.MapType = 1
gmap.AnimateCamera(cp)
If verifica_citta <> "" Then ToastMessageShow("Clicca sul punto Rosso per ottenere il tuo itinerario...",True)
gmap.AddMarker2( toLat, toLon, indirizzo,1).InfoWindowShown = True
End If
End Sub