Find out more about OpenStreetMap's upcoming license change (translations) (discussion)

Static map images

From OpenStreetMap Wiki

(Redirected from Staticmaps)
Jump to: navigation, search
Help
Available languages
EnglishItaliano


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

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
  • mapnik
  • cycle
  • osma
  • mapnik
  • cycle
  • osma
  • skiing
  • maplint
  • cloudmade
  • mapnik
  • cycle
  • osma
  • piste
  • topo
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

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

  • 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.

Personal tools
Namespaces
Variants
Actions
Recent changes
Navigation
Toolbox