[openstreetmap/openstreetmap-website] Allow specifying extra layer options in layers.yml (PR #5386)
Anton Khorev
notifications at github.com
Sat Dec 7 16:36:09 UTC 2024
Now you can (re)define other options accepted by Leaflet tile layers, for example `url` or `maxZoom`. Also you define new tile layers that are not present in `leaflet.osm.js` because `leafletOsmId` is no longer mandatory.
This lets you add, for example, dark version of Transport Map by adding to `config/layers.yml`:
```yml
- url: 'https://{s}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}{r}.png?apikey={apikey}'
maxZoom: 21
code: "U"
keyId: "transportmapdark"
nameId: "transport_map"
apiKeyId: "THUNDERFOREST_KEY"
credit:
id: "thunderforest_credit"
children:
thunderforest_link:
id: "andy_allan"
href: "https://www.thunderforest.com/"
```
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/5386
-- Commit Summary --
* Allow specifying extra layer options in layers.yml
-- File Changes --
M app/assets/javascripts/leaflet.layers.js (2)
M app/assets/javascripts/leaflet.map.js (27)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/5386.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5386.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5386
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5386 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241207/d4df9130/attachment.htm>
More information about the rails-dev
mailing list