Wiki:Maps

From OpenStreetMap Wiki
Jump to navigation Jump to search

Given that OpenStreetMap is about geographic data, it seems logical to include maps in this wiki as well. This article outlines the options using a map sample of Vienna.

Slippy maps

Slippy maps are flexible displays of maps. You can pan around and zoom. This is very helpful in case a reader wants to see the map out of the framed area or needs to find the next bigger city to orient themselves.

Raster maps

Use the {{Slippymap}} template, which is powered by the Kartographer extension and Leaflet:

{{slippymap
 |lat=   48.2274
 |lon=   16.3835
 |zoom=  15        (12 default)
 |width= 300       (400 default)
 |height=300       (400 default)
 |layer= Leaflet   (Standard tile layer is the default)
}}

Optionally add marker=no to remove the pin.

Additionally, the extension supports all featured tile layers. You just can not see them directly. You need to select them from the menu. The list of layers is defined in Mediawiki:Kartographer.js and it is occasionally updated to match the list of featured tile layers.

Vector maps

Some articles need to embed maps based on vector tiles, for example because none of the raster featured tile layers includes the kind of feature being described. The {{Vector map}} template embeds a slippy map powered by MapLibre GL JS. It works similarly to the {{Slippymap}} template, with the addition of some parameters for vector-specific features such as rotation and tilting.

{{Map compare}} embeds an interactive comparison between two maps with a slider that you can scrub back and forth. Both templates are powered by Module:Vector map.

Static maps

Static maps are displays of map data which can not be moved by the reader. This might be less distracting for them.

Images

The easiest option is to include images of maps. This can be done by taking a screenshot of the Homepage and uploading it into the wiki.

[[File:Nordwestbahnhof Wien Openstreetmap 170924.jpg|200px]]

Nordwestbahnhof Wien Openstreetmap 170924.jpg

Standard tiles

You can also directly include tiles from the tile servers in the wiki. So you will not need to upload anything and the tile might be updated, but on the other hand, you can not choose the exact area to display.

https://tile.openstreetmap.org/15/17875/11359.png

11359.png

Linking to maps

Linking to the standard map is preferable over displaying maps when often used on a page as it avoids long loading times and breaking text blocks.

{{Map|latitude|longitude|zoom level|link text}}

Link to a map of Vienna

Similar templates are available from Category Templates for Maps.