7

The geo: URI scheme doesn't seem to work for me on the iphone safari browser. Has anyone had any luck implementing this? Here is an example piece of code:

<a href="geo:39.555551,-82.814171;">Test</a>

The above works on android phones... are there any alternatives to this? Thanks for the help!

D_C
  • 926
  • 3
  • 11
  • 28

3 Answers3

8

The geo: scheme, being relatively new, isn't supported by any builtin apps on iOS. (It's a good idea for a feature request, though.)

One alternative (supported all the way back to iPhone OS 1.0) is to use a Google Maps URL. For example: http://maps.google.com/maps?ll=37.331044,-122.029202 -- this will get automatically redirected to the Maps application. (I dunno if or how this might change with the forthcoming non-Google-backed Maps in iOS 6, though.)

It's also possible to register a third-party app to handle URL schemes not used by system apps, so you could create your own geo handler if that's useful to you.

rickster
  • 124,678
  • 26
  • 272
  • 326
  • I think ivy's answer is more useful than this. – Rob Grant Jan 10 '14 at 06:35
  • I tried to add 'geo' into Info.plist among custom URL schemes supported by my iOS app. Still, typing the address in Safari does not open my app, although other URL schemes do work. Wonder how could the Google Earth app make it work. – lef Jan 15 '14 at 12:36
  • for people who are looking for an apple maps example: [http://maps.apple.com/maps?q=-8.012960,110.308998](http://maps.apple.com/maps?q=-8.012960,110.308998) – escapedcat May 21 '15 at 08:24
5

On my iPhone (ios6), the google earth app opens the geo: link. For native google maps app support, I use the comgooglemaps: scheme, and apple maps will open if you click a 'normal' http://maps.apple.com/ link.

ivy
  • 5,539
  • 1
  • 34
  • 48
2

You can also handle this in pure Javascript. Its easiest using Dojo, jQuery or some other JS library that offers delegated event support.

https://github.com/prowestgis/dojo-geo-uri-polyfill

Lucas
  • 8,035
  • 2
  • 32
  • 45