Peel me a Grape :: We make things work

We Make Things Work :: Blog

Not too long ago Google launched static maps which will generate an single image of the map you want. This rocks! so often one wants to just show a particular view of a map - without the overhead of loading the entire Google Maps UI.

I was curious about how to convert a static map into a normal Google Map - perhaps 95% of the time I wouldn't be interested in browsing or changing a map - but want that option if needs be.

Den Odell points out an example of how to load Google Maps javascript on demand - by inserting a script tag into the DOM, and using the callback parameter to specify a function to call when the script is loaded.

Here's a quick example converting a simple static map. (go here if map isn't loading - key used in example is only valid the articles main page.)

convert
static map

Download example source

blog comments powered by Disqus