From 1e1d27106465aa7937ddd70ebf9209bbed7fdd7f Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 22 Aug 2023 10:16:53 +0200 Subject: [PATCH] Only call propagateShow at init if layer is visible fix #1263 We were calling popagateShow at datalayer init, which then add a listener to "loaded" event, and then do the propagate. So when the layer is hidden at load, when dragging it in the datalayers list, it will be loaded (because we need to save it with its new position) and it will appears as shown whatever its real status. --- umap/static/umap/js/umap.controls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index f48c34e4..76ca83df 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -663,7 +663,7 @@ L.U.DataLayer.include({ L.U.DataLayer.addInitHook(function () { this.on('hide', this.propagateHide) this.on('show', this.propagateShow) - this.propagateShow() + if (this.isVisible()) this.propagateShow() }) L.U.Map.include({