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

Grid Snap Editing #190

Open
nathron opened this issue Aug 13, 2019 · 0 comments
Open

Grid Snap Editing #190

nathron opened this issue Aug 13, 2019 · 0 comments

Comments

@nathron
Copy link

nathron commented Aug 13, 2019

I need to edit polygon vertices snapping to a grid (integer coordinates).
I tried using leaflet.snap, but that will snap to the lines and not the intersections, so I captured editable:vertex:dragend and adjusted vertex position. I don't get how it is possible to move the corresponding polygon vertex under the handle

map.on('editable:vertex:dragend', function (e) { var lat = (Math.round(e.vertex.latlng.lat)); var lng = (Math.round(e.vertex.latlng.lng)); var newLatLng = new L.LatLng(lat, lng); e.vertex.setLatLng(newLatLng); }

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

1 participant