Tuesday, August 25, 2009

Static Maps API v2: Encoded Paths, Polygons & Geocoding

Two years ago, we announced the Static Maps API. This API allowed developers to generate images that represented maps with markers and paths, and to embed those images in webpages. Developers embraced this API as a way to put lightweight thumbnails on their site (like Glotter) and as a way to create non-Javascript versions of their websites (like LonelyPlanet and Orbitz), and they clamored for more features to extend the functionality of their sites.

Now, in order to support the top requested features and to make it easy to fulfill future requests, we've rewritten the API and are launching the new interface as Static Maps API v2. The main new features are:

  • Paths can be specified as encoded polylines. (Issue 205)
  • Paths can be filled and rendered as polygons. (Issue 792)
  • Locations (in center, markers, or path parameters) can now be specified as addresses instead of latitude/longitude coordinates.
  • Colors can now be specified as any 24-bit or 32-bit color.

To show off the new stuff (and my recent vacation in Japan), I've developed a Secret Treasures of Kyoto" mobile-friendly website. You can use it to visit a park where monkeys roam free in Arashiyama (using a filled path), to walk from our hotel to a restaurant with the most delicious deep fried roast beef sandwiches (using a path), or to stalk a creepy looking soft-shelled turtle (using a turtle-colored marker). Check out the iframed website below, or in your mobile browser:

All of the old features are supported in the new API but some of the URL parameters have changed, so if you're a developer that's already using the old API, please refer to the upgrade guide. (That also means that Static Maps v1 is being deprecated - but don't worry, there's plenty of time to upgrade).

If you're a developer that wants to take advantage of the new features, read through our developer guide. To play around with everything right now, try the new Static Maps v2 Wizard.