Open Mapping app like Waze, Google Maps, and Apple Maps (iOS only) From Salesforce1

661    Asked by nitin_7621 in Salesforce , Asked on Aug 5, 2021

I have requirement :

Add a "Directions" button on the restaurant mobile page,"Directions" button should pass the restaurant's location to the device's selected mapping app. Once this button is tapped, the user should be prompted to select their mapping app.

So Using VF page (Salesforce1) how can I open Mapping apps like Waze, Google Maps, and Apple Maps (iOS only) etc ?

For Skype we can use the "skype://call?415-555-1212" URL Scheme. Regarding Mapping applications, what URL scheme do I need to use?


Answered by Ben Butler

1.) Waze Map:

          var address = "{!Account.ShippingStreet}, " + "{!Account.ShippingCity}, " + "{!Account.ShippingPostalCode}, " + "{!Account.ShippingCountry}";
    var encodedAddress = encodeURIComponent(address);"waze://?q="+encodedAddress +"navigate=yes");

2.) Apple Maps (iOS only):

"maps:// Daddr="+encoded long"& directions mode=driving");

3.) Google Maps :

if (mobileOperSys=="iOS")"comgooglemaps://?saddr=My+Location Daddr="+encoded long"&directionsmode=driving");


Your Answer


Parent Categories