Hi,
Im having trouble to enable snapping when im in edit mode.
If i draw a polygon and then another one it snap no problem. Then i hit the edit button and i can edit the two shape no problem except there is no snapping during this process.
After edition if i draw another polygon it snap to the other two as expected.
So my only problem is during edition,there is no snapping,how can i enable it ?
I use Draw 3.0,leaflet 0.7.5 . The snap.js and geometryutil.js are from the exemple.
Here is my code :
$(document).ready(function () {
var guideLayers = [];
var map = L.map('mapContainer', {
layers: MQ.mapLayer(),
center: [46.814184, -71.207425],
zoomControl: true,
zoom: 8
});
var drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems);
var drawControl = new L.Control.Draw({
draw: {
circle: false,
marker: false,
polyline: false,
rectangle:false,
polygon: {
guideLayers: guideLayers,
snapDistance: 5,
allowIntersection: false,
showArea: true,
drawError: {
color: '#b00b00',
timeout: 1000
},
}
},
edit: {
featureGroup: drawnItems,
edit: true,
remove:false
}
});
map.addControl(drawControl);
map.on('draw:created', function (e) {
var type = e.layerType,
layer = e.layer;
drawnItems.addLayer(layer);
guideLayers.push(layer);
});
});
I tried with L.EditToolbar.SnapEdit and didnt get snapping while editing. If someone can help me i would appreciate it thx.
Hi, Im having trouble to enable snapping when im in edit mode. If i draw a polygon and then another one it snap no problem. Then i hit the edit button and i can edit the two shape no problem except there is no snapping during this process. After edition if i draw another polygon it snap to the other two as expected. So my only problem is during edition,there is no snapping,how can i enable it ? I use Draw 3.0,leaflet 0.7.5 . The snap.js and geometryutil.js are from the exemple. Here is my code :
I tried with L.EditToolbar.SnapEdit and didnt get snapping while editing. If someone can help me i would appreciate it thx.