From 629a049eba523d7a8bba792f8332d33444044853 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 16 Dec 2023 18:50:08 +0100 Subject: [PATCH] Inform iconLayers when we change current tilelayer When an editor change the background layer from our own selector, we need to inform iconLayers, so it can update its list and order accordingly --- umap/static/umap/js/umap.controls.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 523d6316..157f32bf 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -1208,7 +1208,9 @@ L.U.TileLayerControl = L.Control.IconLayers.extend({ } const maxShown = 10 L.Control.IconLayers.prototype.setLayers.call(this, layers.slice(0, maxShown)) + if (this.map.selected_tilelayer) this.setActiveLayer(this.map.selected_tilelayer) }, + }) /* Used in edit mode to define the default tilelayer */