fix: only show + button in tilelayer switcher when more available

This commit is contained in:
Yohan Boniface 2024-09-03 15:34:15 +02:00
parent 33b0f6c318
commit ca75955ca9

View file

@ -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'
)