From 36fe84b4ef3f842f8d2df60d921f8a41924279d5 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Tue, 4 Mar 2014 18:42:45 +0000 Subject: [PATCH] warn when some standard layers are turned off not so visible for mobile users - but less of an issue there (as an uninstall/reinstall resets all options to default) for #778 --- code/boot.js | 14 ++++++++++++++ style.css | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/code/boot.js b/code/boot.js index 22838c92..d9d4f884 100644 --- a/code/boot.js +++ b/code/boot.js @@ -242,6 +242,20 @@ window.setupMap = function() { // Remove the hidden layer after layerChooser built, to avoid messing up ordering of layers $.each(hiddenLayer, function(ind, layer){ map.removeLayer(layer); + + // as users often become confused if they accidentally switch a standard layer off, display a warning in this case + $('#portaldetails').html('
' + +'

Warning: some of the standard layers are turned off. Some portals/links/fields will not be visible.

' + +'Enable standard layers' + +'
'); + + $('#enable_standard_layers').on('click', function() { + $.each(addLayers, function(ind, layer) { + if (!map.hasLayer(layer)) map.addLayer(layer); + }); + $('#portaldetails').html(''); + }); + }); map.addControl(window.layerChooser); diff --git a/style.css b/style.css index df690235..f3a0aaf8 100644 --- a/style.css +++ b/style.css @@ -1060,3 +1060,10 @@ table.artifact td.info { .no-pointer-events { pointer-events: none; } + + +.layer_off_warning { + color: #FFCE00; + margin: 8px; + text-align: center; +}