Monday, August 4, 2008

Simulating Driving Directions with the Earth API and Maps' Directions API

Howdy, y'all. My name is Roman Nurik and I'm a newly minted member of the Google Geo APIs team. Some of you may already know me from the Earth Browser Plug-in Google Group. I recently started at Google's headquarters after 4 years at Boston University studying Computer Science and Marketing. My task here at Google is to help you all become experts with the Earth API and KML. In about 5 minutes, you'll realize how psyched I am about it, too.


First Impressions of the Earth API

Back in May before I joined the team, I remember reading one day that Google had released an Earth browser plugin. It really felt like a great moment; finally, immersive and lifelike exploration of geographic content was available to end users on the web, for free. Web developers were also given a cutting-edge tool to marry their existing geo-aware web apps with Google Earth, in all its spherical 3D glory (Maps/Earth integration mode ala G_SATELLITE_3D_MAP).

A few days after I started at Google on the Earth API team, I found a video of Paul Rademacher's Google I/O talk introducing the plugin. It got me thinking—if we can do fun stuff like drive a milk truck around a city crowded with 3D models of real buildings, and fly said milk truck off of our favorite local mountains, can we take this first-person-driver (FPD) concept and apply it to a more real-world problem? The problem of, say, familiarizing yourself with a new driving route before embarking on it in real life? The answer was clear: of course we can! And in that moment, the idea of an Earth plugin driving directions simulator was born!


The Google Earth Plug-in Driving Simulator

After a surprisingly short time fiddling with the Earth and Maps APIs, the first version of the simulator was up and running. Pamela Fox and Mano Marks contributed some ideas and suggestions and the app grew rapidly! Today, I'd like to share the final result with all of you: the Google Earth Plug-in Driving Simulator. Please give the app a spin! Since the plugin currently only supports Windows, users who prefer Mac and Linux will need to borrow a Windows machine. Also, special thanks to the talented artist who contributed the Smart car model used in the app to 3D Warehouse.

Some screenshots (because 3 pictures are worth three thousand words):

Drive Simulator Screenshot 1 Drive Simulator Screenshot 2 Drive Simulator Screenshot 3

The driving directions backend is powered by the GDirections API, which IMHO is a rock star. I also used jQuery, one of my favorite JavaScript libraries, to take the brunt of the work out of Firefox and IE compatible DOM manipulation.

If you have questions on how everything comes together, definitely post them to the previously mentioned Earth plug-in group and I'll be sure to clear things up.


Thanks for reading!

I've had a great experience writing this small app and I'm really psyched to help you all get pumped up and ready to code with the awesome new Earth API. For those of you who haven't tried it out yet—what are you waiting for? As with all of our APIs, the developer community is growing and providing free support at the Earth Browser Plug-in Google Group if you run into trouble. We'd also love to see the cool stuff you're working on!

Thanks for reading; have fun with the driving simulator app! Even more so, have fun with the Earth API! And as always, stay tuned to the Geo Developers blog for more Earthy goodness.