Wikimedia Maps/API

Description of the maps.wikimedia.org api services. Note that usage of the API is limited.

Map Tiles
These map tiles are used by Kartographer to display tiles in a leaflet map viewer.

https://maps.wikimedia.org/{mapstyle}/{z}/{x}/{y}{r}.{filetype}?lang={lang}
 * {mapstyle} is one of osm-intl, osm or osm-pbf
 * osm-intl (default) labels in language {lang} with fallback to language of location
 * osm (without labels)
 * osm-pbf (protocol buffers for vector tiles)
 * {z}, {x}, {y} in the standard OSM url pattern.
 * {r} is optional but used for high density with the  value
 * {filetype}: generally png, but also: json, headers, svg, jpeg, pbf
 * {lang}: the language to use for the labels

Kartographer static map renderings
The static map renderer can generate a specific preview of any area (custom tile) and can also retrieve overlay information from a wiki and add that overlay to the generated img.

https://maps.wikimedia.org/img/osm-intl,{z},{x},{y},{width}x{height}.png?lang={lang}&domain=www.mediawiki.org&title=Help%3AExtension%3AKartographer&groups=_2d548b4a9c350f3449686b3d25f49a17a57aa004


 * domain: domain generating/requesting the image
 * title: title of the page on which the image will be embedded
 * groups: an optional reference to the cached json of the overlays (wikidata, Commons)generated by domain+title. When specified also requires domain and title.

OSM Geoshapes and lines
Returns topojson or geojson shapes and line of OSM relations and ways


 * https://maps.wikimedia.org/geoshape?ids=Q#,Q#
 * https://maps.wikimedia.org/geoline?ids=Q#,Q#

The service will return topojson to the queries such as /geoshape?ids=Q1384,Q1166 (get New York and Michigan state shapes).


 * Additionally, the service allows  parameter to make a query to the http://query.wikidata.org service. It calls the service to execute a query, extracts IDs, and matches them with the shapes in the OSM database. All other values are returned as topojson object properties.
 * Optional truthy parameter getgeojson=1 will force the result to be returned as geojson rather than topojson.

POI images
These POI images are used by Kartographer to overlay features on dynamic maps and used by Kartotherian to render static map images.


 * https://maps.wikimedia.org/v4/marker/pin-m-1+f01080@2x.png

Where
 * pin is the name of the icon
 * m is the size
 * 1 is the number/letter inside the icon when applicable
 * +f01080 is the color for the pin
 * @2x is optional and indicates highdpi resolution of the image