Android Code Snippet Load Map – travel to site show start point and end point on google maps

This is cross-platform :) it is URL based.

Put in the designer a Webview1 and in Globals Private WebView1 As WebView

of course, you can put "origin" another Postcode or city, address etc the same for the destination.

B4X:
Sub LoadMap
private Postcode as string ="CM20 3PX"   ' <--- an example
Activity.LoadLayout("loadmap")      
            WebView1.LoadUrl("https://www.google.com/maps/dir/?api=1&origin=current+location/&destination="&Postcode&"&dir_action=navigate")
End sub


upload_2018-2-8_16-8-58.png


More info about how to use the API Maps URLs
https://developers.google.com/maps/documentation/urls/guide
 
Last edited:
Top