From 05bbed786c94b9160746901f8158c0ac8d530b5f Mon Sep 17 00:00:00 2001 From: Andrey Stepanov Date: Sat, 2 Nov 2024 09:48:39 +0500 Subject: [PATCH 1/2] tweak trains and trainlines displayed zoom --- public/js/map/overlays/TrainOverlay.js | 2 +- public/js/map/overlays/TrainlineOverlay.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/js/map/overlays/TrainOverlay.js b/public/js/map/overlays/TrainOverlay.js index a907669..c548ca3 100644 --- a/public/js/map/overlays/TrainOverlay.js +++ b/public/js/map/overlays/TrainOverlay.js @@ -71,7 +71,7 @@ export default L.LayerGroup.extend({ getMaxDisplayedZoom: function(){ - return 10; + return 7; }, createMarker: function(train){ diff --git a/public/js/map/overlays/TrainlineOverlay.js b/public/js/map/overlays/TrainlineOverlay.js index c717dc5..517ac01 100644 --- a/public/js/map/overlays/TrainlineOverlay.js +++ b/public/js/map/overlays/TrainlineOverlay.js @@ -58,6 +58,10 @@ export default AbstractGeoJsonOverlay.extend({ } }); }, + + getMaxDisplayedZoom: function(){ + return 4; + }, createGeoJson: function(objects){ var self = this; -- 2.46.2 From 0f82ec089653286e60a7cb71e8762b2f5f5ca5be Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Mon, 25 Nov 2019 10:15:15 +0100 Subject: [PATCH 2/2] Show layer selector only if more that one layer --- 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", -- 2.46.2