Secrets and Surprises in Geo APIs Summer Learning Series

The second session of the Geo track at Google I/O was “Secrets of the Surprises of the Google Geo APIs.” Going into I/O we wanted to have a session that could serve as a foundation for later sessions and one where we can feature some of the latest launches leading up to Google I/O. We covered features of the Maps API v3, the Earth API, Fusion Tables, the Maps API Web Services and the Static Maps API in this one session.

What we hope that you take away from this talk is that there is more to the Maps API than just putting markers on a map – we’ve been actively adding many cool features that can really enhance your mapping application and create a better experience for your users.

Here’s a small subset of the features discussed in the talk:

  • With an ever-growing list of cities with 45° imagery available you’re now able to give your users a new perspective of what a place looks like.
    Don’t forget that there are several easy to enable layers available to quickly add content to your map.
  • Developers have frequently requested the ability for API applications users to drag direction routes around the map in a similar manner to Google Maps, so as you might have guessed, enabling draggable directions in the Maps API is now as simple as a one line code change.
  • A favorite feature of the Maps API is the ability to style the base Google map. With the power to change not only the features shown on the map but the color scheme of those features you have tremendous ability to theme your map to fit a look or brand or remove features that are relevant to your users.
  • Street View in the Maps API v3 is implemented entirely in HTML and Javascript so it’s usable on mobile devices with capable browsers without the use of a plugin. This also gives you the power to provide your own custom panoramic imagery and link it to our standard Street View imagery. Don’t let the experience end at the front door – take your users indoors!
  • We’ve added a Distance Matrix service that lets you quickly and easily get travel time and distance between many origins and destinations in one call.
  • In addition to providing driving, walking and bicycling directions the directions service will even optimize the route, determining the best order to visit several destinations.

We talked about a lot more – including AdSense integration, the Places API, useful open source libraries, Fusion Tables and historical imagery, trees and 3D buildings in the Earth API – check out the video or review the slides to learn more!

The Distance Matrix

I often found myself on long car journeys with nothing to occupy me but a dog-eared UK road atlas. On the back page, there was a chart that showed the driving distance and journey time between pairs of major cities, and I would amuse myself figuring out which pair was furthest apart, and how long it takes to drive the length and breadth of the country.Thanks to the new Distance Matrix service, which we are launching today, I can now relive these moments from my youth. The Distance Matrix service is a simple and efficient way to obtain the travel distance and time between many locations when you do not need the full route details for any individual pair. The below applications generates a distance matrix for walking from major London railway stations to several London landmarks. Roll your mouse over the matrix cells, or tap a cell, to see the relevant route.

The Distance Matrix service is also useful for sorting or filtering search results. For example, let’s say your Maps API application enables users  to find nearby grocery stores and you want to present the results sorted by drive time. The locations are stored in a spatial database such as Google Fusion Tables, which can return all stores within a given straight line distance. Using the Distance Matrix service you only need one more query to obtain the drive time from the user’s location to each of those stores in order to sort them accordingly.

The Distance Matrix service is available for use directly in the JavaScript Maps API as well as a web service returning JSON or XML. To get started, take a look at the Maps API services documentation, and the Distance Matrix API web service documentation.