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

Change 748307 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/Kartographer@master] Allow configuring 3rd party tile servers

https://gerrit.wikimedia.org/r/748307

This patch provides some initial fixes for 3rd party tileserver usage that is not a full blow Kartotherian server.
It does not complete the full goals of this ticket, but it is a start.

Next step would be an option to disable static image fallbacks.

Change 748307 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Allow configuring 3rd party tile servers

https://gerrit.wikimedia.org/r/748307