[openstreetmap/openstreetmap-website] Use baselayerchange/overlaylayerchange instead of layeradd/layerremove (PR #5474)
Roman Deev
notifications at github.com
Fri Jan 10 23:51:52 UTC 2025
Okay, firing events from `addObject` / `removeObject` turned out to be the best idea. And I changed this PR to use `baselayerchange`/`overlaylayerchange`
I also replaced layeradd for `map.on("layeradd",...)`, which tracks the layer's on/off state with `dataLayer.on("add", ...)`. Using `overlaylayerchange` in this case doesn't work, because this event isn't thrown when opening a new page with `...&layers=D` Plus `add ' / 'remove' looks cleaner in my opinion.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5474#issuecomment-2584926028
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5474/c2584926028 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250110/bbaa2e04/attachment.htm>
More information about the rails-dev
mailing list