[openstreetmap/openstreetmap-website] Move more map layer logic to MapLayers lib to simplify JS (PR #5832)

Tom Hughes notifications at github.com
Wed Mar 26 18:28:48 UTC 2025


@tomhughes commented on this pull request.



> @@ -3,6 +3,10 @@ def self.full_definitions(layers_filename)
     YAML.load_file(Rails.root.join(layers_filename))
         .reject { |layer| layer["apiKeyId"] && !Settings[layer["apiKeyId"]] }
         .map do |layer|
+          layer["name"] = I18n.t("site.index.map.base.#{layer['nameId']}")

I mean it can, as you've now demonstrated. Is it a good idea? I'm not sure...

What I do know is that the embed page is still a problem with that solution, as it also build the layer definitions into a javascript asset.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5832/review/2718266598 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250326/90e3bbb8/attachment.htm>


More information about the rails-dev mailing list