mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix: Do not error when escape during marker creation
Co-authored-by: Yohan Boniface <yohanboniface@free.fr>
This commit is contained in:
parent
fe011d89e2
commit
519302b53d
1 changed files with 3 additions and 0 deletions
|
@ -1029,6 +1029,9 @@ U.Editable = L.Editable.extend({
|
|||
onEscape: function () {
|
||||
this.once('editable:drawing:end', (event) => {
|
||||
this._umap.tooltip.close()
|
||||
// When hitting Escape before adding a marker,
|
||||
// it tries to edit an unconnected marker.
|
||||
if (event?.layer?.feature?.datalayer === null) return
|
||||
// Leaflet.Editable will delete the drawn shape if invalid
|
||||
// (eg. line has only one drawn point)
|
||||
// So let's check if the layer has no more shape
|
||||
|
|
Loading…
Reference in a new issue