From f80d47120377a81b2b5783ed2aebfb2746d88411 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 26 Jul 2024 13:16:43 +0200 Subject: [PATCH] wip: do not sync twice on commit --- umap/static/umap/js/modules/rendering/ui.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/umap/static/umap/js/modules/rendering/ui.js b/umap/static/umap/js/modules/rendering/ui.js index ea669097..63043cf3 100644 --- a/umap/static/umap/js/modules/rendering/ui.js +++ b/umap/static/umap/js/modules/rendering/ui.js @@ -109,10 +109,9 @@ const FeatureMixin = { }, onCommit: function () { - this.geometryChanged() + this.geometryChanged(false) this.feature.onCommit() }, - } export const LeafletMarker = Marker.extend({ @@ -124,9 +123,11 @@ export const LeafletMarker = Marker.extend({ this.setIcon(this.getIcon()) }, - geometryChanged: function() { + geometryChanged: function (sync = true) { this.feature.coordinates = this._latlng - this.feature.sync.update('geometry', this.feature.geometry) + if (sync) { + this.feature.sync.update('geometry', this.feature.geometry) + } }, addInteractions() {