diff options
author | Markus Koch <markus@notsyncing.net> | 2020-04-19 22:26:35 +0200 |
---|---|---|
committer | Markus Koch <markus@notsyncing.net> | 2020-04-19 22:26:35 +0200 |
commit | 94c05d535868d67832f05a270f8ed55b1fa33f72 (patch) | |
tree | d597693d3be6b9959b796cad8ee064e1272a21c7 | |
parent | ba466fe474572c67b3c5fbfe2b2699ee2bea2fb1 (diff) | |
download | lifomapserver-94c05d535868d67832f05a270f8ed55b1fa33f72.tar.gz lifomapserver-94c05d535868d67832f05a270f8ed55b1fa33f72.tar.bz2 lifomapserver-94c05d535868d67832f05a270f8ed55b1fa33f72.zip |
editor: Center on object after loading new coords
-rw-r--r-- | htdocs/streeteditor.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/htdocs/streeteditor.js b/htdocs/streeteditor.js index ced38ea..53f9b52 100644 --- a/htdocs/streeteditor.js +++ b/htdocs/streeteditor.js @@ -76,6 +76,13 @@ if (editor_mode) { polyline = L.polyline(coords).addTo(mymap); // polyline.on('dragend', onDragEnd); // TODO: Doesn't work, see "workaround" below polyline.enableEdit(); + if (interactive) { + console.log(coords); + latlng = L.latLng(coords[0][0] + (coords[coords.length - 1][0] - coords[0][0]) / 2, + coords[0][1] + (coords[coords.length - 1][1] - coords[0][1]) / 2); + console.log("NEW=" + latlng); + jump_to(latlng, 8); + } } } |