Static map images

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Static map images
· English · italiano · 日本語

Static maps images offer an easy way to embed maps on a webpage.

You simply use an <img /> tag (in pure HTML or via a CMS). Its 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.


Comparison Matrix

Functionality OSM Static maps API v0.3 StaticMap staticMapLite Tyler
URL - DISABLED - Pending Disable
Map types
  • mapnik
  • cycle
  • osma
  • mapnik
  • cycle
  • osma
  • skiing
  • maplint
  • cloudmade
  • mapnik
  • cycle
  • osma
  • piste
  • topo
  • Anything with a standard tile scheme
Image types gif, jpeg jpeg, png png png
Supported URL Parameters
Google API No lat/lon/zoom Yes lat/lon/zoom
OSM Permalink Yes Yes No Yes
Support of Markers
Markers Yes Yes Yes No
Multiple Markers Yes max. 10 Yes No
Custom Markers No URL based 3 styles No
GUI No Yes staticMapWizzard No
Support of Path / Vectors / Polygons / Overlays
Paths Yes Yes No No
Polygons Yes  max. 4 No No
Scale Bar Yes No No No


Things To Do

  • a more consistent approach (parameters) for interoperability
  • a good documentation for developers and skilled end-users
  • separation 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 its own request parameter syntax. If you are planning to use one of those, read the documentation 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

  • lat
  • lon
  • zoom
  • layers
  • width
  • height

Google Static Maps API

  • center = latitude,longitude
  • zoom
  • size = width,height
  • format
  • maptype
  • markers
  • path
  • span
  • frame
  • h1
  • sensor

WMS Client getMap Request

  • version
  • request = getmap
  • service = mapnik, osma
  • layers
  • styles
  • srs = EPSG:3857 || EPSG:4326
  • bbox
  • width
  • height
  • format
  • bgcolor
  • transparent
  • exceptions

The schemes Google Static Maps API and WMS Client getMap Request are for compatibility reasons encouraging people the switch with little adjustments needed.