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

Anton Khorev notifications at github.com
Thu Jan 16 16:23:18 UTC 2025


@AntonKhorev commented on this pull request.



>          this.addLayer(this.baseLayers[i]);
       } else {
+        baselayerChanged = this.hasLayer(this.baseLayers[i]);

The answer to the above question was *yes* but it probably didn't affect anything. However if we start using `baselayerchange` in more places, it might. For example, this code, if rewritten for `baselayerchange` wouldn't work correctly, if it expects this event to happen like Leaflet would fire it:

https://github.com/openstreetmap/openstreetmap-website/blob/b45eb03a6c026ec0f19415100c7bb14c4c53e6cb/app/assets/javascripts/index.js#L208-L216

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

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


More information about the rails-dev mailing list