Page MenuHomePhabricator

Tool "commons-coverage" loads map tiles from OSM
Closed, ResolvedPublic

Description

https://tools.wmflabs.org/commons-coverage/: http://c.tile.openstreetmap.org/2/1/1.png
https://tools.wmflabs.org/commons-coverage/: http://a.tile.openstreetmap.org/2/2/1.png
https://tools.wmflabs.org/commons-coverage/: http://a.tile.openstreetmap.org/2/1/2.png
https://tools.wmflabs.org/commons-coverage/: http://b.tile.openstreetmap.org/2/2/2.png

Loading from external providers are discouraged. Please see parent tasks and J65.
In your case replacements could be:

or:

I'm not extremely familiar with the maps project. You might want to refer to https://www.mediawiki.org/wiki/Maps.

Event Timeline

I have changed this in my code:

var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';

to this:

var osmUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png';

It works fine, but in the previous variable, there was a {s} that I don't know if it is possible to add for wikimedia tiles mirror.

I'm not very familiar with OSM tiles. What's {s} for?

Placeholder {s} should be for subdomains:

https://github.com/Leaflet/Leaflet/blob/2dbda53cc384b378fa156c3e810e4b823e411579/src/layer/tile/TileLayer.js#L164

Generally several subdomains (server names) are provided to get around browser limitations on the number of simultaneous HTTP connections to each host. Browser-based applications can thus request multiple tiles from multiple subdomains faster than from one subdomain.

With HTTP/2, domain sharding may not be necessary anymore.

@Ricordisamoa Thanks. Then I think I don't have to use it in my code anymore.