My Maps -> Static Map Live Converter
To use this, pass the ID of the My Map via the "&msid=" parameter.
You can find it in the "&msid=" parameter when you are viewing a map and click "Link to this page".
It will turn the markers, paths, and polygons into a static map, using the
Static Maps API v2.
Keep in mind that many browsers have a max URL length for images, so there
is a limit to how many overlays will fit into a static map URL.
You can try these IDs:
- Sydney blackout: 109250181535574469723.0004665074a7b33dd9869
- Test Map: 109250181535574469723.00047209aa022982954a2
You can download the source code and modify it for your own needs.
This code was inspired by a PHP version made by Pamela Fox
Added features
-
Polygon simplification
When the generated URL exceeds 2048 characters, the polyline resolution is reduced to fit this limit. Now you can put long routes into static maps. Click here for a demonstration.
-
Additional output formats for changes propagation
If you copy the image URL and paste in your site any changes you made to your Map wouldn't replicate to your site. Now it accepts the following outputs for hot-linking:
- HTML output: iframe it
- URL output: retrieve the url
- JSONC output: retrieve a XSS compatible JSON. It accepts the `callback` parameter indicating which function should be called. The default value is `callback`.
- Image: a JS that inserts the map in the same position as the "script" tag is in the HTML. This output has a 60 seconds memory cache.
- ImageTest: a live HTML demo for the /image output
-
Parameter forwarding
The following parameters are now forwarded to the Static Maps API
- sensor (default = false)
- size (default = 640x640)
- maptype
- language
- format
- center
- zoom
The current implementation also forwards the `markerSize`, `color` and `fillcolor` parameters, but those should be read from the KML in the future.
Demo
Parsing msid = 109250181535574469723.0004665074a7b33dd9869
http://maps.google.com/maps/api/staticmap?sensor=false&size=640x640&path=enc%3AptumEwwzy%5B%7CMaCtKj%40%7CFzKnKxY%60h%40nEzOe%5Ee%5Et%5ElXePbEw%5CdL%7DDzMeMrB_%5Cy%40f_%40fEyJnKkw%40wa%40aHjTk_A%7BGyg%40zG_l%40pc%40ePwYpt%40cFvX%3FjDiD%3FgE_N%7DGxIqB%7CLsFbWyPa%40%7DJ%7CE_p%40dPuK%60HeNzOtGr%40%7EDxBr%40pKcBzRmZgFu%5CFsC%60UyRx%40kLaDmKrHpN%7Cq%40fMuIzXtAjHoEhDgDtAgBbNrH
