From 3ffa29802e322149a7ed609cc0d1ecf144495979 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 15 Dec 2023 17:11:49 +0100 Subject: [PATCH] Use a variable to make explicit max number of shown layers --- umap/static/umap/js/umap.controls.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index b97fa58b..67baa3dc 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -1189,7 +1189,8 @@ L.U.TileLayerControl = L.Control.IconLayers.extend({ icon: L.Util.template(layer.options.url_template, map.demoTileInfos), }) }) - L.Control.IconLayers.prototype.initialize.call(this, layers.slice(0, 10), { + const maxShown = 10 + L.Control.IconLayers.prototype.initialize.call(this, layers.slice(0, maxShown), { position: 'topleft', manageLayers: false })