Fun with Google Maps

Share this article

Google Maps launched a couple of weeks ago, and is another dramatic victory for dynamic web applications. If you haven’t seen it yet, go check it out (IE/Windows or Firefox/Mozilla only at the moment, but Safari support is “coming soon”). It’s a really impressive piece of work, with the main “wow” factor coming from the dynamic panning – just drag and drop to move around the map, with new map tiles loading seamlessly in the background.

Other features include smart route plotting (search for washington dc to chicago for an example), keyboard navigation and integrated search results from Google Local. It’s already giving established map sites a run for their money, with its only real weakness being a complete lack of coverage of areas outside of North America.

But how does it work? Look under the hood and you’ll find a surprising mix of technologies. Remote scripting (communicating with the server without reloading the page) is achieved using both XMLHttpRequest and invisible iframes, with the iframes used because unlike XMLHttpRequest they integrate sensibly with the user’s back button. Add to that both XSLT and VML (Microsoft’s SVG alternative, introduced before the SVG specification was standardised) and you’ve got one of the most advanced web applications I’ve ever seen on the public internet.

jgwebber has an excellent dissection of the client-side bits, and there’s a thread on my other blog discussing some of the inner workings.

Figuring out how it works is only the half of it; there’s a growing collection of hacks for the service. Jon Udell pointed out a hidden XML interface to the underlying data, which has now been discontinued. Even better, the libgmail project has posted a number of bookmarklets which directly manipulate Google Maps, including some which can animate the routes suggested by the service (see Jon Udell’s screencast). They’re great fun to play with and reveal even more details about the JavaScript API. The Google Maps tile grabber is fun as well.

It’s all exciting stuff, but I can’t help but feel slightly concerned. For all its bells and whistles, Google Maps is similar to GMail in that it remains completely inaccessible without a modern, JavaScript-enabled desktop browser. Building applications like this that gracefully degrade may be harder but it’s certainly not impossible, as map.search.ch smartly demonstrates. I hope that in the exciting new gold rush towards truly dynamic web applications recent advances in the fields of accessibility (both for users and platforms) are not forgotten.

Simon WillisonSimon Willison
View Author
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week
Loading form