[openstreetmap/openstreetmap-website] Use baselayerchange/overlaylayerchange instead of layeradd/layerremove (PR #5474)

Anton Khorev notifications at github.com
Thu Jan 16 00:41:53 UTC 2025


@AntonKhorev requested changes on this pull request.



> @@ -116,6 +116,7 @@ L.OSM.Map = L.Map.extend({
       } else {
         this.removeLayer(this.baseLayers[i]);
       }
+      this.fire("baselayerchange", { layer: this.baseLayers[i] });

This fires the event for every possible base layer. It's supposed to be fired only for the layer that became visible, that's how it works in `leaflet.layers.js`.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5474/review/2554420556 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250115/be8efedc/attachment.htm>


More information about the rails-dev mailing list