B4J Question GoogleMap - Set location from text address

jmon

Well-Known Member
Licensed User
Longtime User
Nevermind, I found a solution just using the webview:
B4X:
wvMap.LoadUrl($"https://www.google.com/maps/place/eiffel+tower+paris"$)
Just replace eiffel tower paris with any location. You have to replace the spaces with a plus sign.
 
Upvote 0

b4auser1

Well-Known Member
Licensed User
Longtime User
More universal:
B4X:
Public Sub Map_Location_By_TextAddress(a_sTextAddress As String) As String
    Dim su As StringUtils
    Return $"https://www.google.com/maps/place/${su.EncodeUrl(a_sTextAddress, "UTF8")}"$
End Sub
 
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
More universal:
B4X:
Public Sub Map_Location_By_TextAddress(a_sTextAddress As String) As String
    Dim su As StringUtils
    Return $"https://www.google.com/maps/place/${su.EncodeUrl(a_sTextAddress, "UTF8")}"$
End Sub
Excellent, thank you!
 
Upvote 0
Top