Private Sub MapFragment1_Click (Point As LatLng)
gmapp.AddMarker(Point.Latitude, Point.Longitude, "Markierung")
End Sub
the user can add markers and when he taps the marker, he can ask for directions (lower right corner, left symbol) or search for any place (lower right corner, right symbol). The user will not know this before he/she tries it out.
I would like to have the right symbol - search places - permanently on the screen.
Public Sub ShowPointsInMap(Latitude As Double, Longitude As Double)
Dim GoogleMapIntent As Intent
GoogleMapIntent.Initialize(GoogleMapIntent.ACTION_VIEW, $"http://maps.google.com/maps?q=${Latitude},${Longitude}"$)
GoogleMapIntent.SetComponent("android/com.android.internal.app.ResolverActivity")
StartActivity(GoogleMapIntent)
End Sub
Ah, this is much better than what I did. My "solution" was just a workaround.
I just put a button with a map-symbol on the map and then
B4X:
private Sub Bmap_Click
Dim p As PhoneIntents
StartActivity(p.OpenBrowser("http://maps.google.com/?q=" & mypoint.Latitude & "," & mypoint.Longitude))
' mypoint is the center of the map displayed or the position of the last marker set
End Sub
Public Sub ShowPointsInMap(Latitude As Double, Longitude As Double)
Dim GoogleMapIntent As Intent
GoogleMapIntent.Initialize(GoogleMapIntent.ACTION_VIEW, $"http://maps.google.com/maps?q=${Latitude},${Longitude}"$)
GoogleMapIntent.SetComponent("android/com.android.internal.app.ResolverActivity")
StartActivity(GoogleMapIntent)
End Sub
Public Sub ShowPointsInMap(Latitude As Double, Longitude As Double)
Dim GoogleMapIntent As Intent
GoogleMapIntent.Initialize(GoogleMapIntent.ACTION_VIEW, $"http://maps.google.com/maps?q=${Latitude},${Longitude}"$)
GoogleMapIntent.SetComponent("android/com.android.internal.app.ResolverActivity")
StartActivity(GoogleMapIntent)
End Sub