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/5...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to