Merge pull request #2095 from umap-project/fix-tilelayer-plus-button

fix: only show + button in tilelayer switcher when more available
This commit is contained in:
Yohan Boniface 2024-09-03 15:35:08 +02:00 committed by GitHub
commit c321a9e70d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -801,7 +801,7 @@ U.TileLayerControl = L.Control.IconLayers.extend({
_createLayerElements: function () { _createLayerElements: function () {
L.Control.IconLayers.prototype._createLayerElements.call(this) 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( const lastRow = this._container.querySelector(
'.leaflet-iconLayers-layersRow:last-child' '.leaflet-iconLayers-layersRow:last-child'
) )