User:Dan Shick (WMDE)/Drafts/Help:Extension:Kartographer/Getting started

Overview
Kartographer is an extension to MediaWiki that enables interactive and static maps for wiki pages.

Wikis with the extension enabled allow users to easily create maps displayed inside a wikipage, or links to fullscreen maps, as easily as writing a single line of wikitext or clicking on a menu item in the VisualEditor.

This guide focuses on maps in wikitext; for instructions on maps in the VisualEditor see Help:VisualEditor/Maps.

Quick start: example


This code produces a simple 250x250 map in a frame, like the one you see in this section, with the caption "Downtown San Francisco".


 * On Wikivoyage and test2wiki, this embedded map is interactive.
 * On Wikipedia and other Wikimedia wikis, this embedded map is static.

Map in frame:
To add a map that appears in a small window (or frame) on a wikipage, use the tag.

In its simplest form,  requires the following information to display a map:
 * a location (latitude and longitude)
 * the size of the frame (width and height)
 * the zoom level

Example:

If you specify features using GeoJSON (see below [link]), then zoom, latitude and longitude may be omitted.

For more detail, see https://www.mediawiki.org/wiki/Help:Extension:Kartographer#%3Cmapframe%3E.

Link to fullscreen map:
Instead of an interactive map on the wiki page itself, you can also link to a fullscreen interactive map. The only difference is that you use the  tag instead of.

For more detail, see https://www.mediawiki.org/wiki/Help:Extension:Kartographer#%3Cmaplink%3E.

GeoJSON
GeoJSON is a structured way of representing geographic information that uses the JSON standard.

A Kartographer map doesn't need any GeoJSON to work, but GeoJSON opens up a wide swath of functionality that's not available in Kartographer alone, like markers, geoshapes from external sources like OpenStreetMap, special styling and more.

Composing GeoJSON
Regardless of whether you're creating your Kartographer-powered map in wikitext or the VisualEditor, you'll likely want a separate tool to compose your GeoJSON.

We recommend the GeoJSON.io editor (https://geoman.io/geojson-editor) and this helpful guide (https://handsondataviz.org/geojsonio.html).

In wikitext, GeoJSON goes inside the &lt;mapframe> or &lt;maplink> tag (instead of closing the tag with "/").

Without GeoJSON:



With GeoJSON:

 { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122.3988, 37.8013] }, "properties": { "title": "Exploratorium", "description": "", "marker-symbol": "museum", "marker-size": "large", "marker-color": "0050d0" } }

In the VisualEditor, you can paste in the GeoJSON you've composed by clicking on the "Map contents" tab in the Map dialog.

Markers
GeoJSON allows you to define markers that pinpoint locations on your map, using syntax that conforms to simplestyle and icons drawn from the Maki set (CC0).