Skip to content

Conversation

@th-himanshu
Copy link

Problem
The DistortableImageOverlay was behaving inconsistently when added dynamically. This was caused by attempting to bind DOM events to img.getElement() before the element was fully injected into the Leaflet pane, or while the GoogleMutant layer was still re-ordering the DOM.

Changes
Switched from L.DomEvent.on(img.getElement(), 'load', ...) to the Leaflet-native img.on('add', ...) event.

Ensured event listeners are only attached once the layer has a valid DOM presence.

Corrected the edit listener to bind to the Leaflet layer instance instead of the raw HTML element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant