[openstreetmap/openstreetmap-website] Generate maplibre styles from `layers.yml` (PR #6772)
Marwin Hochfelsner
notifications at github.com
Sat Feb 7 16:10:41 UTC 2026
@hlfan commented on this pull request.
> @@ -20,4 +31,45 @@ def self.embed_definitions(layers_filename)
.select { |entry| entry["canEmbed"] }
.to_h { |entry| [entry["layerId"], entry.slice("leafletOsmId", "leafletOsmDarkId", "apikey").compact] }
end
+
+ def self.style_from_style_url(layer, key)
+ layer[key].sub("{apikey}", layer["apikey"] || "")
+ end
+
+ def self.style_from_tile_url(layer, key)
+ url_template = layer[key]
+ .sub("{r}", "{ratio}")
It's probably better to replace `{ratio}` with `{r}` only in the leaflet layer options for now so we don't need need to change the YAML file again in the migration.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6772#discussion_r2777728551
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6772/review/3767366006 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260207/3dc0e382/attachment.htm>
More information about the rails-dev
mailing list