[openstreetmap/openstreetmap-website] Use baselayerchange/overlaylayerchange instead of layeradd/layerremove (PR #5474)
Anton Khorev
notifications at github.com
Thu Jan 16 14:31:01 UTC 2025
@AntonKhorev commented 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] });
Yes, looks like our layers menu is wrong. Leaflet's layer selector doesn't fire `baselayerchange` if you clicking an already active layer, and if you add an already added layer using `map.addLayer`, layer events also don't happen.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5474#discussion_r1918663454
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5474/review/2556338963 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250116/fc39487e/attachment.htm>
More information about the rails-dev
mailing list