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/c2584926...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to