You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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); }
The text was updated successfully, but these errors were encountered:
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); }
The text was updated successfully, but these errors were encountered: