Static map images
From OpenStreetMap Wiki
Static maps images offer an easy way to embed maps on a webpage.
You simply use an <img /> tag.
It's src attribute forms a request, specifying the location of the map, the size of the image, the zoom level, the type of map, etc.
When the webpage is displayed, the browser requests the image from the Static Maps script and it renders within the image location.
The Static Maps script can be hosted within your webspace or on an osm (dev-)server.
Contents |
Approaches
There are multiple implementations varying in supported features and request parameter syntax
- Static Maps API [1]
- StaticMap [2]
- staticMapLite + staticMapWizzard
- MapOf
- Bigmap
- ws-compose and ws-pinwin
- Export tab - Uses MapOf for osmarender images and another perl script by TomH for Mapnik images (sidebar form code)
Of course you can also grab a static map images by simply taking a screenshot. Simply press 'prnt scrn' button on your keyboard, then paste the image from your clipboard to another app. You may prefer to use other screenshotting utilities such as the Firefox plugin FireShot. Before taking a screenshot go full screen on your browser (press f11) for a larger image. Some browsers have a zoom feature which rescales the tile images. Use this to achieve half-zoom levels.
Comparison Matrix
| Functionality | OSM Static maps API v0.3 | StaticMap | staticMapLite | ||
|---|---|---|---|---|---|
| URL | http://pafciu17.dev.openstreetmap.org | http://ojw.dev.openstreetmap.org/StaticMap | http://dev.openstreetmap.de/staticmap/ | ||
| Map types |
|
|
| ||
| Image types | gif, jpeg | jpeg, png | png | ||
| Supported URL Parameters | |||||
| Google API | No | lat/lon/zoom | Yes | ||
| OSM Permalink | Yes | Yes | No | ||
| Support of Markers | |||||
| Markers | Yes | Yes | Yes | ||
| Multiple Markers | Yes | max. 10 | Yes | ||
| Custom Markers | No | URL based | 3 styles | ||
| GUI | No | Yes | staticMapWizzard | ||
| Support of Path / Vectors / Polygons / Overlays | |||||
| Paths | Yes | Yes | No | ||
| Polygons | Yes | max. 4 | No | ||
| Scale Bar | Yes | No | No | ||
Things To Do
- a more consistent approach (parameters) for interoperatibility
- a good documentation for developers and skilled end-users
- seperation of actual tile rendering and interface/wizzard/tool scripts
- more links throughout this wiki
- list of some external use examples
People who are working on this
Proposal for unified Request Parameters
Besides varying in supported features each implementation has it's own request paramater syntax. If you are planning to use one of those, read the documetation that comes with it.
Below you find a proposal for a more unified approach. Eventually some projects will adapt or implement compatibility modes.
OSM Scheme
|
Google Static Maps API
|
WMS Client getMap Request
|
The schemes Google Static Maps API and WMS Client getMap Request are for compatibility reasons encouraging people the switch with little adjustments needed.