Use a variable to make explicit max number of shown layers

This commit is contained in:
Yohan Boniface 2023-12-15 17:11:49 +01:00
parent 49c17d6fd1
commit 3ffa29802e

View file

@ -1189,7 +1189,8 @@ L.U.TileLayerControl = L.Control.IconLayers.extend({
icon: L.Util.template(layer.options.url_template, map.demoTileInfos), 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', position: 'topleft',
manageLayers: false manageLayers: false
}) })