From 2f66953774c806852aab57137c4b6666c54909dd Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sun, 29 Sep 2013 00:11:48 +0100 Subject: [PATCH] draw-tools: update edit colour to match that used while drawing - with only dashed lines being used as in stock Leaflet.Draw --- plugins/draw-tools.user.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/draw-tools.user.js b/plugins/draw-tools.user.js index a9ee160d..335825f3 100644 --- a/plugins/draw-tools.user.js +++ b/plugins/draw-tools.user.js @@ -33,6 +33,7 @@ window.plugin.drawTools.loadExternals = function() { } window.plugin.drawTools.setOptions = function() { + window.plugin.drawTools.lineOptions = { stroke: true, color: '#a24ac3', @@ -42,16 +43,15 @@ window.plugin.drawTools.setOptions = function() { clickable: true }; - window.plugin.drawTools.polygonOptions = { - stroke: true, - color: '#a24ac3', - weight: 4, - opacity: 0.5, + window.plugin.drawTools.polygonOptions = L.extend({}, window.plugin.drawTools.lineOptions, { fill: true, - fillColor: null, - fillOpacity: 0.2, - clickable: true - }; + fillColor: null, // to use the same as 'color' for fill + fillOpacity: 0.2 + }); + + window.plugin.drawTools.editOptions = L.extend({}, window.plugin.drawTools.polygonOptions, { + dashArray: [10,10] + }); window.plugin.drawTools.markerOptions = { icon: new L.Icon.Default(), @@ -113,7 +113,8 @@ window.plugin.drawTools.addDrawControl = function() { featureGroup: window.plugin.drawTools.drawnItems, edit: { - title: 'Edit drawn items' + title: 'Edit drawn items', + selectedPathOptions: window.plugin.drawTools.editOptions, }, remove: {