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 GeoJSON data on the same page and not show it all in the same map.

By default all  tags on a page will show a map with all the data from the   and   tags. Clicking a  link will also show the same map. On the other hand, the data inside the  itself will only be shown in that one map, but not in the other map frames or links.

Optionally, both  and   tags can use a   attribute. If set, tag's data is added to a group by that name, e.g.  (lower case English letters only). The data with a group name will continue showing up in all of the links and frames, unless they specify which groups to show by using  attribute:.

This is the summary of what data each tag will show on a page.