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
This commit is contained in:
Jon Atkins 2014-03-04 18:42:45 +00:00
parent 03cabcbdb6
commit 36fe84b4ef
2 changed files with 21 additions and 0 deletions

View File

@ -242,6 +242,20 @@ window.setupMap = function() {
// Remove the hidden layer after layerChooser built, to avoid messing up ordering of layers // Remove the hidden layer after layerChooser built, to avoid messing up ordering of layers
$.each(hiddenLayer, function(ind, layer){ $.each(hiddenLayer, function(ind, layer){
map.removeLayer(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('<div class="layer_off_warning">'
+'<p><b>Warning</b>: some of the standard layers are turned off. Some portals/links/fields will not be visible.</p>'
+'<a id="enable_standard_layers">Enable standard layers</a>'
+'</div>');
$('#enable_standard_layers').on('click', function() {
$.each(addLayers, function(ind, layer) {
if (!map.hasLayer(layer)) map.addLayer(layer);
});
$('#portaldetails').html('');
});
}); });
map.addControl(window.layerChooser); map.addControl(window.layerChooser);

View File

@ -1060,3 +1060,10 @@ table.artifact td.info {
.no-pointer-events { .no-pointer-events {
pointer-events: none; pointer-events: none;
} }
.layer_off_warning {
color: #FFCE00;
margin: 8px;
text-align: center;
}