Phabricator project: #maps

Maps

From MediaWiki.org
(Redirected from OpenStreetMap)
Jump to: navigation, search

This project within the Discovery department aims to make OpenStreetMap available on all Wikimedia projects, at a scale sufficient for their widespread usage.

Openstreetmap logo.svg

OpenStreetMap and the Wikimedia Discovery Department have collaborated to launch a new trial map tile rendering service available at https://maps.wikimedia.org. With this service we hope to encourage our community to create tools and integrations to develop new ways for readers and editors to discover Wikimedia content. We strongly believe that our knowledge engine needs to be powered by multiple entry points and think that maps are a key discovery tool.

Current status[edit | edit source]

The service is currently in a experimental mode meaning that at times it may be rapidly changing and unstable. Currently, we can only handle traffic from *.wmflabs.org and *.wikivoyage.org (referrer header must be either missing or set to these values) but we hope to open it up to Wikipedia traffic if we see enough use.

You can interact with the live beta at https://maps.wikimedia.org

The Discovery department is looking for your feedback and ideas for ways of using maps to determine further development.

Cartographer Extension[edit | edit source]

We are also working on an extension to wiki syntax to support maps called Kartographer.. It will allow editors to insert a map and add article specific data into wiki pages, such as shapes and points of interest. Kartographer will also have a Visual Editor interface to make it easy to add maps.

A demo of Kartographer can be found on http://vem3.wmflabs.org/wiki/Main_Page

Mobile Apps[edit | edit source]

The Wikipedia Android app shows all nearby articles on a map using the Maps service.

Getting started[edit | edit source]

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}.{format}
  • https://maps.wikimedia.org/{style}/{z}/{x}/{y}@{scale}x.{format} - with the optional scaling factor
URL parameters
style Map style to use. Use "osm-intl" for map with labels, "osm" for map without labels.
z zoom level, 0-18
x, y Web Mercator grid coordinates
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}.png', {
    maxZoom: 18,
    id: 'wikipedia-map-01',
    attribution: 'Wikimedia maps beta | Map data &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
}).addTo(map);

An example of a map that uses our tiles is at maps.beta.wmflabs.org, source.

Static map images[edit | edit source]

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

URL parameters
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

Milestones and Updates[edit | edit source]

Future plans[edit | edit source]

Please help us plan by adding any use-cases you think would benefit the Wiki communities

Production maps cluster[edit | edit source]

The production maps cluster (See also on Wikitech) is in development by the WMF Discovery team. The implementation has various components including:

  • Kartotherian Github (primary) / Gerrit (mirror) - a server capable of providing map tiles in vector (pbf) or raster (png) formats, as well as static map snapshots of any size for a given location.
  • Tilerator Github (primary) / Gerrit (mirror) – a distributed backend tile generation service with a jobque
  • A flexible sources system to set up the needed storage and processing pipeline

A version of the tile server is now in operation at maps.wikimedia.org.

  • It serves tiles at URLs such as https://maps.wikimedia.org/osm-intl/11/327/791.png (bitmap) or .../791.json (OSM data – waterways, roads, place labels, etc.).
  • It can scale images for the high-DPI devices – e.g. 1.5x, 2x, etc .../791@1.3x.png
  • It can provide static maps with a given size and scaling, e.g. https://maps.wikimedia.org/img/osm-intl,6,44.8247,4.9981,1000x600.png
  • For now, maps.wikimedia.org only accepts requests from the domains in wmflabs.org, *.wikivoyage.org, or incubator.wikimedia.org.
  • http://maps.beta.wmflabs.org is a simple map server that serves the Leaflet JavaScript library and some static files to provide a pannable, zoomable map using the Production maps cluster.
  • Please adapt your own labs tools to use maps.wikimedia.org! Set your tool's domain to *.wmflabs.org.

See also[edit | edit source]