1

On the iPhone, links of the form maps.google.com are opened by the google maps app, which is installed on every iPhone. (see: Apple URL scheme reference)

The mobile site of maps.google.com supports more functionality than the native maps app (like the transit layer).

Is there a way to formulate an html link that would cause safari to open the maps link in the browser instead of launching the native maps app?

Here's an example link that opens in the Maps App that I'd rather have opened by mobile Safari:

http://maps.google.com/maps?q=boston&lci=transit_comp

pnuts
  • 58,317
  • 11
  • 87
  • 139
zzz
  • 2,515
  • 4
  • 28
  • 38
  • You could open the google maps mobile on a UIWebView directly in your app...but perhaps it's not the best choice for you. – Mat Apr 14 '12 at 17:15

2 Answers2

2

use https instead of http.

https://maps.google.com/maps?q=boston&lci=transit_comp

EDIT:

You could also resolve the domain name yourself then use the IP address.

http://173.194.34.165/maps?q=boston&lci=transit_comp

TomSwift
  • 39,369
  • 12
  • 121
  • 149
  • Doesn't work. On my iPad 2 w/ iOS 5.1 it still opens the Maps app, not in Safari. – Franci Penov Apr 14 '12 at 23:02
  • @Franci Penov - No need to downvote... But you're right. What's interesting it an https://maps.google.com link sent via email opens it in Safari. Clicking the same link from within a web page opens it in Maps. At least on my iPhone. Does the same happen on your iPad? – TomSwift Apr 14 '12 at 23:08
  • 1
    Using the IP address appears to work. I wouldn't likely hard-code the address in my app, but you could easily write code to resolve the address to a current IP then dynamically edit your links. – TomSwift Apr 14 '12 at 23:19
1

Try adding the variable &ui=maps to the end of your URL string.

Steve Czetty
  • 6,147
  • 9
  • 39
  • 48
Chris Lambrou
  • 356
  • 2
  • 7