Please Google, can we have Google Maps API for iPhone?
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?




















September 25th, 2008 at 2:48 pm
[…] 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 […]
September 25th, 2008 at 3:28 pm
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.
September 25th, 2008 at 6:36 pm
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).
September 25th, 2008 at 9:00 pm
@Wes Biggs. No not yet. I have yet to implement any lat/lng to pixel transforms. I will drop you a line when done!
September 26th, 2008 at 6:42 am
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!
September 26th, 2008 at 9:52 am
@Pamela Yup, sorry, changed to openstreet map tiles now…
September 26th, 2008 at 11:00 am
[…] 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 […]
September 26th, 2008 at 2:27 pm
[…] 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 […]
September 28th, 2008 at 9:20 pm
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.
September 28th, 2008 at 10:45 pm
@Tuinkslak
Check here: http://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariWebContent/AppleApplicationsURLSchemes/chapter_950_section_4.html#//apple_ref/doc/uid/TP40006513-SW5 (ADC membership required).
I think you use the ’saddr’ parameter for the source address and ‘daddr’ for the destination. I.e. http://maps.google.com/?saddr=vilvoorde&daddr=antwerp
September 29th, 2008 at 12:15 am
Thanks a lot! Seems to be working now. Guess I didn’t search far enough.
September 29th, 2008 at 12:39 am
[…] thanks to alastair for helping out on this […]
February 25th, 2009 at 9:59 pm
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.