Skip to content
Snippets Groups Projects
Commit e011cbdc authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat: Display warning status text for all valid warning status values

parent edd71f3b
No related branches found
No related tags found
1 merge request!12feat: Add test page (spatial) with mapserver layer in openlayers map
...@@ -126,9 +126,7 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution, mapId) { ...@@ -126,9 +126,7 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution, mapId) {
const clickTop = mapTop + pixel[1] - 100; const clickTop = mapTop + pixel[1] - 100;
// Hide when warning status is 0 // Hide when warning status is 0
if (warningStatus.getAttribute('value') === '0') { if (warningStatus.getAttribute('value') in warningStatusText) {
featureInfoDiv.style.display = 'none';
} else {
featureInfoDiv.innerHTML = warningStatusText[warningStatus.getAttribute('value')]; featureInfoDiv.innerHTML = warningStatusText[warningStatus.getAttribute('value')];
featureInfoDiv.style.display = 'block'; featureInfoDiv.style.display = 'block';
featureInfoDiv.style.opacity = "1" featureInfoDiv.style.opacity = "1"
...@@ -140,6 +138,8 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution, mapId) { ...@@ -140,6 +138,8 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution, mapId) {
setTimeout(function() { setTimeout(function() {
featureInfoDiv.style.opacity = "0"; featureInfoDiv.style.opacity = "0";
}, duration); }, duration);
} else {
featureInfoDiv.style.display = 'none';
} }
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment