OneWheeledBicycle

Random mutterings of Alastair James

Please Google, can we have Google Maps API for iPhone?

with 13 comments

I have recently been experimenting with writing travel related web apps for the iphone. Its all great. Some of the HTML5 stuff in the new version of iPhone Safari is great (local databases etc..). However, one thing has been bothering me. I cant use Google Maps as I would like to. Ok, I can include links to the google maps site that open in the native google maps application, but this is not optimal because:

  • It takes the user out of my web application
  • Does not allow me to integrate the maps with my application. I.e. add many markers. Do something when a marker is clicked.

So this got me thinking, would it be possible to do a ‘lite’ version of the javascript maps API for the iPhone? Before the newest version of mobile Safari, this would not have been possible. Fundamentally you cant drag the map! However, with the new version Apple introduced a javascript API for sensing single and double finger drag events. 

So, I went about knocking up a very basic test version (try it on your iphone, tinyurl: http://tinyurl.com/3g5tg4). Is buggy, basic and sub-optimal, but proves it could work nicely. Try zooming with the double finger pinch action! 

I also tried the new webkit CSS transforms to allow free zooming and rotation, however they are buggy and slow on the iphone! Oh well! Anyway, maybe we can have google maps lite on the iphone?

Written by aljames

September 25, 2008 at 10:03 am

Posted in Coding, Google maps

13 Responses

Subscribe to comments with RSS.

  1. […] iPhone experience. Alastair James wanted to use the Google Maps JavaScript API on the iPhone, and wrote up his thoughts: Before the newest version of mobile Safari, this would not have been possible. Fundamentally you […]

  2. Alastair, what were the issues you experienced with CSS transforms and did you file bug reports? It would be very useful for us at Apple to get more information about the issues you encountered? Feel free to email me to discuss this.

    Antoine Quint

    September 25, 2008 at 3:28 pm

  3. Alastair, this is very cool. Does it take lat/long coordinates? If so I’ll hook it into Locatable (http://lbs.tralfamadore.com) so it can get a CoreLocation reading (or you can integrate the W3C javascript API).

    Wes Biggs

    September 25, 2008 at 6:36 pm

  4. @Wes Biggs. No not yet. I have yet to implement any lat/lng to pixel transforms. I will drop you a line when done!

    alastair

    September 25, 2008 at 9:00 pm

  5. Cool demo, but please change it to use a different mapping provider if you’re going to continue working on it. Creating wrapper APIs with our tiles isn’t permitted by the Terms of Use. Thanks!

    Pamela Fox

    September 26, 2008 at 6:42 am

  6. @Pamela Yup, sorry, changed to openstreet map tiles now…

    alastair

    September 26, 2008 at 9:52 am

  7. […] September 26, 20081:59 am Google Maps JavaScript API for iPhone Alastair James wanted to optimize Google Maps usage in his mobile apps, but that wasn’t […]

  8. […] iPhone experience. Alastair James wanted to use the Google Maps JavaScript API on the iPhone, and wrote up his thoughts: Before the newest version of mobile Safari, this would not have been possible. Fundamentally you […]

  9. Do you happen to know if there is anyway to access the “directions” on the iPhone Maps app?

    I have an iPhone website, that adds a simple “maps.google.com/?q=location1 to location2” (e.g.: http://maps.google.be/?q=vilvoorde%20to%20antwerp), but when clicking that URL from an iPhone, Maps errors with “no results”. While it should get loaded under the “directions” tab.

    Any idea?

    Thanks.

    Tuinslak

    September 28, 2008 at 9:20 pm

  10. alastair

    September 28, 2008 at 10:45 pm

  11. Thanks a lot! Seems to be working now. Guess I didn’t search far enough.

    Tuinslak

    September 29, 2008 at 12:15 am

  12. […] thanks to alastair for helping out on this […]

    iRail maps | Tuinslak

    September 29, 2008 at 12:39 am

  13. Check out mapNinja, it’s an iPhone SDK that lets you enable your apps with a google-maps style experience in just a matter of minutes. No javascript hacks, this is a pure native application for iPhone.

    Chris Glode

    February 25, 2009 at 9:59 pm


Leave a reply to alastair Cancel reply