Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rectangle setBounds breaks refreshVertexMarkers #204

Open
DenofTranquility opened this issue May 6, 2021 · 1 comment
Open

Rectangle setBounds breaks refreshVertexMarkers #204

DenofTranquility opened this issue May 6, 2021 · 1 comment

Comments

@DenofTranquility
Copy link

Hi

I am trying to update a rectangle on vertex drag and when using setBounds it returns the error:
TypeError: latlngs[i].__vertex is undefined

I have tried passing in the bounds as new L.latLngBounds, as new L.latLng() and also as an array of all 4 corners. I can't seem to get it to work,
It could be that I'm missing something, any help would be appreciated
Thanks

@egormkn
Copy link

egormkn commented Oct 17, 2023

I encountered the same error trying to use Leaflet.Editable with react-leaflet. Current implementation stores references to editing markers inside of LatLng objects and any manual changes to the vector layer will override them.

The only workaround I have found so far is to call disableEdit() before and enableEdit() after changing bounds. This does not allow changing bounds in real time and only reliably works on dragend and editable:vertex:dragend events.

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

No branches or pull requests

2 participants