Wikimedia Maps/2015-2017/Technical Implementation
Appearance
Getting started
[edit]maps.wikimedia.org
serves standard Web Mercator raster tiles so it should be a drop-in replacement for other tileservers serving OpenStreetMap-based imagery. To point a tool to our mapserver, use the following URL schema:
- https://maps.wikimedia.org/{style}/{z}/{x}/{y}{r}.{format}
- https://maps.wikimedia.org/{style}/{z}/{x}/{y}@{scale}x.{format} - with the optional scaling factor
style | Map style to use. Use "osm-intl" for map with labels, "osm" for map without labels. |
z | zoom level, 0-19 |
x, y | Web Mercator grid coordinates |
r | Standard retina option (@2x) |
scale | Optional scale for the high-resolution screens such as Retina. Supported scales are 1.3, 1.5, 2, 2.6, 3 |
format | Use "png" for now, but you can also use "pbf" from the /osm style to get the raw vector tiles. |
Adding a maps within Leaflet is as easy as
var style = 'osm-intl';
var server = 'https://maps.wikimedia.org/';
// Create a map
var map = L.map('map').setView([40.75, -73.96], 4);
// Add a map layer
L.tileLayer(server + style + '/{z}/{x}/{y}{r}.png', {
maxZoom: 19,
id: 'wikipedia-map-01',
attribution: 'Wikimedia maps beta | Map data © <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
}).addTo(map);
An example of a map that uses our tiles is at https://maps.wikimedia.org, source.
Static map images
[edit]Maps are also capable of serving static images, such as https://maps.wikimedia.org/img/osm-intl,7,43.66,4.719,800x600.png
URL: https://maps.wikimedia.org/img/{style},{z},{lat},{lon},{width}x{height}@{scale}x.png
style | Map style to use. Use "osm-intl" for map with labels, "osm" for map without labels. |
z | Zoom level, 0–18 |
lat, lon | Latitude and longitude of the map center |
width, height | Image size in pixels without scalling |
scale | Optional scale for the high-resolution screens such as Retina. Supported scales are 1.3, 1.5, 2, 2.6, 3 |
See Also
[edit]- Tile server implementation - technical details on how the server presenting and storing the map tiles is implemented