Open app for location on webpage page from ios browser

I want to make a link on my mobile website that will launch a location-based application (like waze or google maps) to open in location.

following html code:

<a href="geo:32.0783087,34.81842779999999">go to location</a> 

works great with android browsers but doesn't work with iphone (using safari or chrome)

How to do this for iphone / ipad browsers?

+4
source share
1 answer

To open google maps on ios, you need to use a specific URL scheme (for each application, if provided), for example, the following calls will display google maps:

 comgooglemaps://?daddr=%f,%f&saddr=%f,%f&mrsp=0&ht=it&ftr=0", contactPosition.latitude, contactPosition.longitude, myPosition.latitude, myPosition.longitude 

and this wil open waze:

 waze://?ll=37.331689,-122.030731&navigate=yes 

In both cases, the user obviously needs to install applications for this to work.

+11
source

Source: https://habr.com/ru/post/1483924/


All Articles