From 0c9d5325ba9288c77988ae4517189ecb96026832 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 12 Mar 2025 12:23:54 +0100 Subject: [PATCH] fix: use real redraw for datalayer, instead of hide/show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The problem we've tried to fix is, during sync: - peer A is editing a feature - peer B changes the datalayer of this feature - edit panel is closed for peer A Co-authored-by: Alexis Métaireau --- umap/static/umap/js/modules/data/layer.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index a7fb4603..761945b0 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -144,11 +144,10 @@ export class DataLayer extends ServerStored { if (fields.includes('options.type')) { this.resetLayer() } - this.hide() for (const field of fields) { this.layer.onEdit(field, builder) } - this.show() + this.redraw() break case 'remote-data': this.fetchRemoteData() @@ -652,8 +651,7 @@ export class DataLayer extends ServerStored { redraw() { if (!this.isVisible()) return - this.hide() - this.show() + this.eachFeature((feature) => feature.redraw()) } edit() {