Skip to content

Commit

Permalink
Show layer selector only if more that one layer (#411)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre-Yves Rollo <[email protected]>
  • Loading branch information
standmit and pyrollo authored Nov 11, 2024
1 parent a7b5226 commit e1c9bdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/js/components/LayerSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ function onchange(e){
m.route.set("/map/:layerId/:zoom/:lon/:lat", params);
}


export default {
view: function(){
// Display layer selector only if there is choice
if (LayerManager.layers.length <= 1)
return null;

const layers = LayerManager.layers.map(layer => m(
"option",
Expand Down

0 comments on commit e1c9bdb

Please sign in to comment.