Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open location app from webpage link from ios browser

I wish to make a link in my mobile website that will trigger a location based application (as waze or google maps) to open in location.

the following html code:

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

working great with android browsers, but not working with iphone (using safari or chrome)

How can it be done to work with iphone/ipad browsers?

like image 983
masterweily Avatar asked Dec 21 '22 04:12

masterweily


1 Answers

To open google maps on ios you have to use a specific url scheme (specific for each application, if provided) for example the following will call 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 to have this working the user, obviously, should have the apps installed.

like image 177
oiledCode Avatar answered Dec 24 '22 10:12

oiledCode