From ca75955ca99297c9ca2a995b40c3ed7bb9274dc4 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 3 Sep 2024 15:34:15 +0200 Subject: [PATCH] fix: only show + button in tilelayer switcher when more available --- 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 508f5550b..33d0c2821 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -801,7 +801,7 @@ U.TileLayerControl = L.Control.IconLayers.extend({ _createLayerElements: function () { L.Control.IconLayers.prototype._createLayerElements.call(this) - if (Object.keys(this._layers) <= this.maxShown) return + if (Object.keys(this._layers).length <= this.maxShown) return const lastRow = this._container.querySelector( '.leaflet-iconLayers-layersRow:last-child' )