diff options
author | Markus Koch <markus@notsyncing.net> | 2020-04-25 18:08:02 +0200 |
---|---|---|
committer | Markus Koch <markus@notsyncing.net> | 2020-04-25 18:08:02 +0200 |
commit | 035eb5a9920ed0507e54b6c9a3c43fab27235385 (patch) | |
tree | 48708e47182a1f70ad7250a741efad305c8df694 | |
parent | 5b5ce97a1a0a8e2bac0b875baddcd59fd8b54b67 (diff) | |
download | lifomapserver-035eb5a9920ed0507e54b6c9a3c43fab27235385.tar.gz lifomapserver-035eb5a9920ed0507e54b6c9a3c43fab27235385.tar.bz2 lifomapserver-035eb5a9920ed0507e54b6c9a3c43fab27235385.zip |
Add editor styling
This function is only partially working atm. It only applies
the style when resuming an existing dataset. When starting
from scratch, the default style will be used.
-rw-r--r-- | htdocs/mapscript.js | 3 | ||||
-rw-r--r-- | htdocs/streeteditor.js | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/htdocs/mapscript.js b/htdocs/mapscript.js index 57fa0f8..3516cbd 100644 --- a/htdocs/mapscript.js +++ b/htdocs/mapscript.js @@ -62,6 +62,9 @@ var style_outlines = { fillOpacity: 0.5 }; +var style_streets = { + }; + // Projection fix from: https://gis.stackexchange.com/questions/200865/leaflet-crs-simple-custom-scale var factorx = 1 / 256 * 4; diff --git a/htdocs/streeteditor.js b/htdocs/streeteditor.js index 6c20e23..4ade184 100644 --- a/htdocs/streeteditor.js +++ b/htdocs/streeteditor.js @@ -9,6 +9,14 @@ if (editor_mode) { var polyline; var edit_active = 0; + + var editor_style = { + radius: 8, + fillColor: "#00ff00", + color: "red", + opacity: 1.0, + fillOpacity: 0.5 + }; function start_editing(dir = 1) { // TODO: Check whether we already are in edit mode @@ -73,9 +81,9 @@ if (editor_mode) { coords[i] = [coords[i][1], coords[i][0]]; } if (editor_mode_polygon) - polyline = L.polygon([coords]).addTo(mymap); + polyline = L.polygon([coords], editor_style).addTo(mymap); else - polyline = L.polyline(coords).addTo(mymap); + polyline = L.polyline(coords, editor_style).addTo(mymap); // polyline.on('dragend', onDragEnd); // TODO: Doesn't work, see "workaround" below polyline.enableEdit(); if (interactive) { |