mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 20:02:36 +02:00
fix: correctly add drawn latlng when continuing line backward
Otherwise the measure if wrong. fix #2069
This commit is contained in:
parent
ab8bce985e
commit
ca4df94e7f
1 changed files with 5 additions and 1 deletions
|
@ -1260,7 +1260,11 @@ U.Editable = L.Editable.extend({
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const tmpLatLngs = e.layer.editor._drawnLatLngs.slice()
|
const tmpLatLngs = e.layer.editor._drawnLatLngs.slice()
|
||||||
|
if (e.layer.editor._drawing === L.Editable.BACKWARD) {
|
||||||
|
tmpLatLngs.unshift(e.latlng)
|
||||||
|
} else {
|
||||||
tmpLatLngs.push(e.latlng)
|
tmpLatLngs.push(e.latlng)
|
||||||
|
}
|
||||||
measure = e.layer.getMeasure(tmpLatLngs)
|
measure = e.layer.getMeasure(tmpLatLngs)
|
||||||
|
|
||||||
if (e.layer.editor._drawnLatLngs.length < e.layer.editor.MIN_VERTEX) {
|
if (e.layer.editor._drawnLatLngs.length < e.layer.editor.MIN_VERTEX) {
|
||||||
|
|
Loading…
Reference in a new issue