Page MenuHomePhabricator

Kartographer: Setting replacement or default fill and stroke properties for GeoJSON ExternalData from Commons (page service)
Open, Needs TriagePublicFeature


Feature summary:
In case of external data from Open Street Map (for services geoline, geoshape) it is possible to specify fill and stroke properties for map features like geolines and geoshapes. This is necessary because these data are usually lacking in these properties. If these properties are not set then default properties are used. Example:

<mapframe text="A geoshape of Alaska" width=300 height=300 zoom=3 longitude=-152.58 latitude=64.01>
  "type": "ExternalData",
  "service": "geoshape",
  "ids": "Q797"
  "properties": {
    "stroke": "#ffb100",
    "stroke-width": 6,

In case of external GeoJSON data from Wikimedia Commons (service: page) it is impossible to add such properties. If anyone adds these properties there will be ignored. Example:

<mapframe width=300 height=400>
  "type": "ExternalData",
  "service": "page",
  "title": "Neighbourhoods/New York"

If the GeoJSON data do not have these properties default values are used by software. The default values are defined in mapbox-lib.js and cannot be overwritten.

Use case(s):
There are two cases:

  1. Many map structures do not use deliberately fill and stroke properties (for instance: But in this case, wiki authors cannot substitude the default values.
  2. In case of maps with several external map structures authors maybe wish to distinguish between them by using individual properties.

I think the new GeoJSON properties should replace properties of the same name if they are present in external data. At least, they should replace the default properties as defined in software. I am not sure if the addition/replacement should be done by Kartographer JavaScript tools or by the mapserver.

This new feature will support all authors of Wikimedia wikis mainly in Wikivoyage projects. The definition of map structures in Wikimedia Commons must not have fill and stroke properties, and they can be used more generally.