I want to open a map with directions, but I would prefer to open Google Maps than The Apple Maps.
so I had the following code.
However, it was always opening Apple maps.
The following code works. It seems CanOpenURL on the Google string *always* failed
I have a queryscheme setup in Main,
#UrlScheme: comgooglemaps
Does anyone know why this is happening?
Also, is there a way to get Apple Maps to navigate to a LATLNG point. There is this article
https://developer.apple.com/library...s.html#//apple_ref/doc/uid/TP40007899-CH5-SW1
but all it says is "An address string that geolocation can understand."
Thanks
so I had the following code.
B4X:
Private googstr As String = "comgooglemaps://maps.google.com?daddr="&Lat&","&Lng
Private mainstr As String = "http://maps.apple.com/?daddr="&Lat&","&Lng&"ll="&Lat&","&Lng&"t=m&dirflg=d"
if (main.app.canOpenURL(googstr)) then
Main.App.OpenURL(googstr)
end if
If (Main.App.CanOpenURL(mainstr)) Then
Main.App.OpenURL(mainstr)
End If
end sub
However, it was always opening Apple maps.
The following code works. It seems CanOpenURL on the Google string *always* failed
B4X:
Sub NavigatetoLatLong(Lat As String, Lng As String)
Private googstr As String = "comgooglemaps://maps.google.com?daddr="&Lat&","&Lng
Private mainstr As String = "http://maps.apple.com/?daddr="&Lat&","&Lng&"ll="&Lat&","&Lng&"t=m&dirflg=d"
Private done As Boolean = Main.App.OpenURL(googstr)
Log("Opened google maps = " & done)
If Not(done) Then
If (Main.App.CanOpenURL(mainstr)) Then
Main.App.OpenURL(mainstr)
End If
End If
End Sub
I have a queryscheme setup in Main,
#UrlScheme: comgooglemaps
Does anyone know why this is happening?
Also, is there a way to get Apple Maps to navigate to a LATLNG point. There is this article
https://developer.apple.com/library...s.html#//apple_ref/doc/uid/TP40007899-CH5-SW1
but all it says is "An address string that geolocation can understand."
Thanks