Google Static Maps API

Admittedly I have completely missed the boat on blogging about the Google Static Maps API which was launched back in February, but I was reminded of them the other day whilst working on a site admin panel.

As the maps I wanted to display were only a small addition to the panel providing a quick snapshot of a location, using the full JavaScript API would have been rather unnecessary.

This is where the static maps prove very useful and are an easy and quick addition to any web page, whether or not you use Google’s static map wizard.

Google Static Maps API Example

Static maps are displayed as images and are configured by a number of parameters sent as part of the image source in the http request, for example:

http://maps.google.com/staticmap?center=51.235912,
-0.751019&zoom=13&size=460x250&key=API_KEY

To use the static maps you are required to sign up for a Google Maps API key which can be obtained from here, although if you already have a JS API key this can be used.

When it comes to road map views the static maps provide you with many of the features available in the JS version, including but not limited to zoom levels, markers and polyline paths.

One downside I encountered was that static maps does not provide the ability to display satellite or hybrid imagery, or at least as far as I am aware.

There is also a query limit of 1000 unique (different) image requests per viewer per day, but a quick browse at the Google Group for the Maps API highlighted a few posts encouraging people to cache their results.

Even if you prefer to stick to the JS version at least now you can display some form of output to any visitors without JavaScript or with JS disabled, although they’re not as dynamic at least there’s something for them visually.

UPDATE

Since originally posting this, Google have announced the new static map features on the Google Maps API Blog, bringing to our attention the introduction of the new marker styles, paths, map image formats and the ability to translate labels into a number of languages. Read the full post here.

Leave a Reply