Extension:Kartographer

Kartographer is an experimental extension to add maps to wikis. It is very similar to Maps extension, but its functionality will be specifically targetting Wikimedia communities such as Wikivoyage and Wikipedia.

Demo
See vem3.wmflabs.org

Goals

 * A simple method to insert a map into an article without requiring common.js code changes
 * Ability to add extra information (marks, area, popups, text, links) to the map
 * Ability to gather map usage statistics (KPI) to better gauge how and what should be improved.
 * TBD: experimentation - if the user is aware of the privacy implications, the map should be able to show external data from non-production source, e.g. wmflabs. Static, server-side rendered images will not include the extra data added via this method until the extra data source is hosted in the secure production environment and can be shown without the user action.

WikiVoyage goals
Wikivoyage tends to have a large number of POIs, such as museums and restaurants, listed on a page (see example and scroll down to the "See" section). Each POI is usually added with a template, but all of them should appear on the same map. Also, each POI should be referable by showing an icon with a number, both in the text of the article, and on the map:
 * Ability to incrementally add features to the map. For example, each usage of the restaurant template adds a single point of interest (POI), and the map shows all of them.
 * Added features need to be indexable. E.g. the first restaurant template would show [1] on the page, and map would show POI as a clickable [1] element. There could be multiple index counters at the same time, each for its own type of POIs.

&lt;mapframe> usage
This sample inserts a map of a given zoom and location (centered) and shows a museum icon. Depending on the client and network speed, the map could be shown as static or interactive. If static, the map can be clicked to show full screen and become interactive. If dynamic, the map should have a "maximize" icon to make it full screen. The content of the  tag has to be either empty or a valid GeoJSON with styling, as produced by GeoJSON editor. Map supports simplestyle specification with Maki icons (CC0).

==  creates a link that shows a full screen map when clicked. The link's text could be either set with the  attribute. Without the  attribute, the word "map" will be shown, unless in GeoJSON, the   is set to the magic   or   value. Each  will be replaced with an incremental counter , and   with   values. If GeoJSON has more than one counter, the value of the first one will be shown as the link's text. Optionally, editors may add a suffix to have multiple counters on the page at the same time. This way  will have different counter from. It would make sense to use a distinct color for each counting group. All data added via  will also be shown in all maps inserted with , unless   attribute is used.

Attributes:,  , and   control the location of the popup map. Use  for the link hint text. Use  for the text of the link (could be any valid wiki markup). Use  to add content of this tag to the named group (see below).

tag
Use  tag to add features to the map without showing any links. only supports  attribute.

Groups
The grouping concept allows us to have more than one set of data on the same page and not show them in the same map. Any GeoJSON data inside the  and   tags is added to the unnamed group, and will be shown on all maps inserted with the , unless   specifies the   attribute, listing just the groups of features that should be included. An editor may set the  attribute on   and   tags. Data defined with a  attribute will show only in the   that either does not have the   attribute, or the one that lists the group by name. Data inside the  only shows for that map, and not for others.

2) ... 3) 4) ... 5) 6) ...

-- shows features from all of the above  -- shows features from all of the above -- shows features #3 and #4  -- shows features #3, #4, #5, and #6