Commit 914a1348 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

No pointer cursor on drawn shapes

parent 54ae9a2a
......@@ -189,7 +189,8 @@ function registerSketch() {
*/
function createShape(layer) {
const feature = layer.toGeoJSON();
feature.properties = layer.options;
feature.properties = Object.assign({}, layer.options);
delete feature.properties.interactive;
const tmpId = shapeLayerTmpId++;
shapesLayersWithoutId[tmpId] = layer;
socket.emit("shape_create", { sid: sid, feature: feature, tmpId: tmpId });
......@@ -371,11 +372,11 @@ function finishShapeDrawing(e) {
let layer;
let layerOpts;
if(cleanNodes.length === 1) {
layerOpts = { stroke: false, fillColor: drawOpts.color, radius: drawOpts.penSize / 2, fillOpacity: drawOpts.opacity, z: map.getZoom() };
layerOpts = { stroke: false, fillColor: drawOpts.color, radius: drawOpts.penSize / 2, fillOpacity: drawOpts.opacity, z: map.getZoom(), interactive: false };
layer = new L.CircleMarkerZ(cleanNodes[0], layerOpts);
}
else {
layerOpts = { color: drawOpts.color, weight: drawOpts.penSize, opacity: drawOpts.opacity, z: map.getZoom() };
layerOpts = { color: drawOpts.color, weight: drawOpts.penSize, opacity: drawOpts.opacity, z: map.getZoom(), interactive: false };
layer = L.polyline(cleanNodes, layerOpts);
}
shapesLayer.addLayer(layer);
......@@ -490,8 +491,8 @@ function changeMode(mode, opts) {
*/
function showShapes(geojson) {
const layer = L.geoJSON(geojson, {
style: feature => feature.properties,
pointToLayer: (feature, latlng) => new L.CircleMarkerZ(latlng, feature.properties)
style: feature => Object.assign({ interactive: false }, feature.properties),
pointToLayer: (feature, latlng) => new L.CircleMarkerZ(latlng, Object.assign({ interactive: false }, feature.properties))
});
shapesLayer.addLayer(layer);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment