From 5247bf77d35b71ff678eec16de9f1888d95f45d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Fri, 31 May 2024 14:49:23 +0200 Subject: [PATCH] refactor(sync): Remove `syncUpdateProperties` function. The function was only used once, so removing it simplified the whole flow. --- umap/static/umap/js/umap.features.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index e2c73d72..eb5838a7 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -25,14 +25,6 @@ U.FeatureMixin = { return this.toGeoJSON().geometry }, - syncUpdatedProperties: function (properties) { - // When updating latlng, sync the whole geometry - if (properties.includes('latlng')) { - const { subject, metadata, engine } = this.getSyncMetadata() - engine.update(subject, metadata, 'geometry', this.getGeometry()) - } - }, - syncDelete: function () { let { subject, metadata, engine } = this.getSyncMetadata() engine.delete(subject, metadata) @@ -652,7 +644,8 @@ U.Marker = L.Marker.extend({ function (e) { this.isDirty = true this.edit(e) - this.syncUpdatedProperties(['latlng']) + const { subject, metadata, engine } = this.getSyncMetadata() + engine.update(subject, metadata, 'geometry', this.getGeometry()) }, this )