[openstreetmap/openstreetmap-website] Put api keys directly in js layer definitions (PR #5352)

Anton Khorev notifications at github.com
Sat Nov 23 23:00:14 UTC 2024


Currently map layer API keys have one extra level of indirection:
- keys are defined in the settings
- `osm.js.erb` reads them from the settings and writes them to `OSM.THUNDERFOREST_KEY` and `OSM.TRACESTRACK_KEY`
- `layers.yml` contain names of `OSM` properties to check for keys

Instead of this `osm.js.erb` could write keys directly to layer definitions, skipping `OSM.THUNDERFOREST_KEY` and `OSM.TRACESTRACK_KEY`. `layers.yml` could contain the corresponding settings names. The advantage is that Thunderforest and Tracestrack keys are no longer special. A new key can be added just by editing `settings.yml` and `layers.yml`. Also it's possible to skip layer definitions if they require a key and that key is missing.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5352

-- Commit Summary --

  * Put api keys directly in js layer definitions

-- File Changes --

    M app/assets/javascripts/leaflet.map.js (14)
    M app/assets/javascripts/osm.js.erb (24)
    M config/layers.yml (6)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5352.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5352.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5352
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5352 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241123/1252faa3/attachment-0001.htm>


More information about the rails-dev mailing list