Opening Google Maps links in iOS 6

Discussion in 'iOS 6' started by crisss1205, Sep 19, 2012.

  1. crisss1205, Sep 19, 2012
    Last edited: Sep 19, 2012

    crisss1205 macrumors 6502a

    crisss1205

    Joined:
    Oct 7, 2008
    Location:
    NYC
    #1
    With iOS 6 Apple decided to remove Google maps and replace it with their own solution. In my opinion the new maps is a lot better. But there is one thing that annoys me. Some apps which have not been updated will open maps links using "http://maps.google.com" (Instagram is an example) which means they will open up in Safari not the maps app.

    To combat this I have created a little bookmark. When an app opens a map link in Safari, all you have to do it go to your bookmarks and tap it. It will then open the same link, with the attributes in the maps app.

    For instructions on how to use the bookmark just visit this blog post I wrote.

    http://blog.cttapp.com/p/open-google-maps-in-maps-app-on-ios-6/
     
  2. protobiont macrumors 6502a

    Joined:
    Jul 6, 2010
    #2
    I will often look up the directions to a place in google maps on my work pc, then email a link to myself to open on my phone. This is especially useful if I'm going to a remote place that doesn't necessarily have an address (as a biologist, I do this often), and I need to find it on the large screen of my office pc. So, I guess these links will open the web browser now and go to google maps?

    So, in that case I could just use your bookmark, and it would take me to the maps app? I'll check it out, and thanks for sharing.
     
  3. protobiont macrumors 6502a

    Joined:
    Jul 6, 2010
    #3
    Well, it worked, sort of. The bookmark works just as intended. Unfortunately, something was lost in translation. I got directions to an "unkown" road in the middle of a state conservation area in Florida, and when I used the bookmark, Apple maps gives me directions to an "unknown road" in Kentucy.

    I'm guessing the instructions imbedded in the map link are using some sort of address system that doesn't involve GPS coordinates. Odd though that it wouldn't at least use zipcodes or something to prevent Apple maps from searching in Kentucky for a road in FL...
     
  4. crisss1205 thread starter macrumors 6502a

    crisss1205

    Joined:
    Oct 7, 2008
    Location:
    NYC
    #4
    Yea, unfortunately I have no control over that. It also seems Apple maps cannot find some places. Essentially Apple maps search sucks. For address links like this, http://maps.google.com/maps?daddr=San+Francisco,+CA&saddr=cupertino it should work perfectly.
     
  5. protobiont macrumors 6502a

    Joined:
    Jul 6, 2010
    #5
    Roger that. I hope I didn't imply any problem with your bookmark tool. I should reiterate that it is really cool what you did, and great of you to share it with everyone!

    I will definitely be using it. It's just a shame that Apple will be letting me down on one of my primary maps use cases... hopefully they iterate on this often and quickly.

    Since you set up the tool, are you able to comment on what information is being passed from the google maps link to the Apple map?
     
  6. crisss1205 thread starter macrumors 6502a

    crisss1205

    Joined:
    Oct 7, 2008
    Location:
    NYC
    #6
    Sure no problem.

    So essentially the phone used to register maps.google.com links with the maps app. Now they changed it so it handles maps.apple.com links instead. However my approach is to use a new URL scheme, which is maps://

    So what I do it take the current Google Maps url, example: https://maps.google.com/maps?daddr=San+Francisco,+CA&saddr=cupertino

    and change it to maps://maps?daddr=San+Francisco,+CA&saddr=cupertino

    iOS uses the same URL parameters as before. Similarly you can also change it to http://maps.apple.com/maps?daddr=San+Francisco,+CA&saddr=cupertino

    If you try the link below, on iOS 6 it will open the Maps App. On iOS 5 and lower, as well as any other browser, it will redirect you to Google Maps.

    http://maps.apple.com/maps?daddr=San+Francisco,+CA&saddr=cupertino

    Source Code

    Also, if you are a developer you can view the documentation, as well as a response from an Apple Engineer about the subject in this forum post.
     
  7. protobiont macrumors 6502a

    Joined:
    Jul 6, 2010
    #7
    So, here's the google maps link that I tested it with.

    When I open this link it sends me to Kentucky. However, if I just send the destination in Google maps:

    It does go to the proper GPS coordinates. It's odd, because the first link also has the GPS coordinates, but it seems like iOS maps ignores it.
     
  8. Edslunch macrumors member

    Joined:
    Sep 27, 2012
    Location:
    Calgary, Canada
    #8
    This is a brilliant solution. Maps works fine for me in my location but I miss the seamless integration with websites and email. This gets it pretty close just wish it was automatic
     

Share This Page