Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying extra layer options in layers.yml #5386

Merged

Conversation

AntonKhorev
Copy link
Collaborator

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:

- 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/"

@tomhughes
Copy link
Member

Nice - making it easier for people reusing the software for other sites to change the map layers has been a long standing problem.

@tomhughes tomhughes merged commit bf4d8fc into openstreetmap:master Dec 8, 2024
22 checks passed
@AntonKhorev AntonKhorev deleted the layer-definitions-extra branch December 8, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants