Page MenuHomePhabricator

Make it easier to configure map layers for 3rd party users
Open, Needs TriagePublic

Description

Background information

Currently, we have

$wgKartographerMapServer = 'https://maps.wikimedia.org'
$wgKartographerDfltStyle = 'osm-intl'
$wgKartographerStyles = ["osm-intl", "osm"]
$wgKartographerSrcsetScales = [1.3, 1.5, 2, 2.6, 3]

And then we manually build a url up internally to the formats:
https://maps.wikimedia.org/osm-intl/4/5/3.png
https://maps.wikimedia.org/osm-intl/4/5/3@2x.png
https://maps.wikimedia.org/osm-intl/4/5/3.pbf etc

What

This has the following problems:

  1. It is hard to adapt your tile server for non-wikimedia. It is for instance impossible to append query parameters.
  2. You cannot specify multiple map baselayers (a very common use case)
  3. You cannot specify any overlay layers

How

Don't see why we ever did it like this. Much easier to separate out concerns.

  1. Add new array config variable to defined map base layers
  2. Each layer specified in the common OSM style of //[a|b|c].tiles.org/${z}/${x}/${y}{r}.png See https://leafletjs.com/reference-1.6.0.html#tilelayer
  3. Add a separate config variable for geoshapes etc url, which really is a completely independent technology service that most 3rd parties will not have access to or use for
  4. Add yet another separate config variable for the map POI icon api.

Then we have separation of concerns, which makes it much easier to maintain, upgrade individual parts of the services and use for 3rd parties.

Open questions

...

Acceptance criteria

  • geoshapes and snapshot services are disabled by default but also configurable
  • Users are able to define another tile server as the source layer
  • User are able to define other endpoints for static images in case it's different from the tile server URL

Event Timeline

TheDJ renamed this task from Make it easier to configure mapplayers for 3rd party users to Make it easier to configure map layers for 3rd party users.Aug 7 2020, 9:18 AM