Skip to content

Commit

Permalink
Merge pull request #2095 from umap-project/fix-tilelayer-plus-button
Browse files Browse the repository at this point in the history
fix: only show + button in tilelayer switcher when more available
  • Loading branch information
yohanboniface committed Sep 3, 2024
2 parents 5e6ac99 + ca75955 commit c321a9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion umap/static/umap/js/umap.controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down

0 comments on commit c321a9e

Please sign in to comment.