From 9cb87392c07332b2babf5cc2aa9ddd5abd19fe66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Thu, 9 May 2024 17:41:55 +0200 Subject: [PATCH] feat(sync): Avoid syncing remote datalayers' features They will be synced on their own, and we dont want them to be present twice on the map. --- umap/static/umap/js/umap.features.js | 3 +++ umap/static/umap/js/umap.layer.js | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index c137173f..e171daf8 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -14,6 +14,9 @@ U.FeatureMixin = { }, onCommit: function () { + // When the layer is a remote layer, we don't want to sync the creation of the + // points via the websocket, as the other peers will get them themselves. + if (this.datalayer.isRemoteLayer()) return const { subject, metadata, engine } = this.getSyncMetadata() engine.upsert(subject, metadata, this.toGeoJSON()) }, diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index e53f1381..b154bc15 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -619,7 +619,6 @@ U.DataLayer = L.Evented.extend({ render: function (fields, builder) { let impacts = U.Utils.getImpactsFromSchema(fields) - console.log('impacts', impacts) for (let impact of impacts) { switch (impact) {