From e1c9bdb8bdc17d9b171554cc46200a03d9c2d872 Mon Sep 17 00:00:00 2001 From: Andrey Stepanov Date: Mon, 11 Nov 2024 23:50:45 +0500 Subject: [PATCH] Show layer selector only if more that one layer (#411) Co-authored-by: Pierre-Yves Rollo --- public/js/components/LayerSelector.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/js/components/LayerSelector.js b/public/js/components/LayerSelector.js index 98a1de6..57fb237 100644 --- a/public/js/components/LayerSelector.js +++ b/public/js/components/LayerSelector.js @@ -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",