Static map images

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages
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.

Approaches

  • Of course you can also grab a static map image by simply taking a screenshot; instructions for this vary between operating systems.
  • OSM's own Export tab is suitable for small-scale non-scripted use.
  • The following services are available and maintained:
  • The following services also exist but may not be recommended due to heavy load on the OSM servers.
    • StaticMap [1]
    • Bigmap
    • Not a service, but it seems that you can find the (old) python script by searching the web for some keyword combination: http://modestmaps.com/examples-python-ws/ ws-compose and ws-pinwin
    • (check above list and move items out of it if known not to cause load)

Comparison Matrix

Functionality OSM Static maps API v0.3 StaticMap staticMapLite Tyler
URL http://pafciu17.dev.openstreetmap.org - DISABLED http://ojw.dev.openstreetmap.org/StaticMap - Pending Disable http://staticmap.openstreetmap.de/ http://tyler-demo.herokuapp.com
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

Meta

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 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:900913 (?)
  • 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.