https://github.com/openstreetmap/openstreetmap-website/commit/de78176e04961c52f1fa1283812ec06ce6eb90cf added `layeradd`/`layerremove` listeners on `map` that check the layer and only do something if it's `noteLayer`. Later https://github.com/openstreetmap/openstreetmap-website/commit/85282f5cdd5b37016027feda0a16d8cbdc6a2581 added `click` listener directly on `noteLayer`. But `layeradd`/`layerremove` could also be installed directly on `noteLayer`, then comparing the layers wouldn't be necessary.
Elsewhere the same thing is considered for data layer: https://github.com/openstreetmap/openstreetmap-website/pull/5474#issuecomment-2584926028 You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/5500 -- Commit Summary -- * Install add/remove event listeners directly on note layer -- File Changes -- M app/assets/javascripts/index/layers/notes.js (22) -- Patch Links -- https://github.com/openstreetmap/openstreetmap-website/pull/5500.patch https://github.com/openstreetmap/openstreetmap-website/pull/5500.diff -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/5500 You are receiving this because you are subscribed to this thread. Message ID: <openstreetmap/openstreetmap-website/pull/5...@github.com>
_______________________________________________ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev