From 463e475fec953297ebf16fd0e24d77ea070e4b8a Mon Sep 17 00:00:00 2001 From: Damon Ulmi Date: Tue, 3 Oct 2023 07:59:37 -0700 Subject: [PATCH] fix(layerStatus): 'loaded' handling refactored for groups fixes #1337 --- .../public/templates/layers/esri-dynamic.html | 33 +++--- .../public/templates/layers/esri-feature.html | 33 +++--- .../public/templates/layers/geocore.html | 12 +- .../public/templates/layers/geojson.html | 11 +- .../public/templates/layers/geopackage.html | 18 +-- .../public/templates/layers/image-static.html | 11 +- .../public/templates/layers/ogc-feature.html | 11 +- .../public/templates/layers/vector-tiles.html | 35 +++--- .../public/templates/layers/wfs.html | 22 ++-- .../public/templates/layers/wms.html | 108 ++++++++++++------ .../public/templates/layers/xyz.html | 11 +- .../public/templates/package-swiper.html | 13 +++ .../raster/abstract-geoview-raster.ts | 26 ++++- .../geoview-layers/raster/esri-dynamic.ts | 3 + .../geoview-layers/raster/image-static.ts | 4 + .../geoview-layers/raster/vector-tiles.ts | 3 + .../geo/layer/geoview-layers/raster/wms.ts | 3 + .../layer/geoview-layers/raster/xyz-tiles.ts | 3 + .../vector/abstract-geoview-vector.ts | 15 +++ .../layer/geoview-layers/vector/geopackage.ts | 44 ++++++- packages/geoview-core/src/geo/layer/layer.ts | 36 ------ 21 files changed, 288 insertions(+), 167 deletions(-) diff --git a/packages/geoview-core/public/templates/layers/esri-dynamic.html b/packages/geoview-core/public/templates/layers/esri-dynamic.html index baf5f405ea0..86556ee8757 100644 --- a/packages/geoview-core/public/templates/layers/esri-dynamic.html +++ b/packages/geoview-core/public/templates/layers/esri-dynamic.html @@ -762,37 +762,40 @@

3. Date filtering using ISO UTC dates

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR1.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField2 = document.getElementById('HLYR2-state'); - const geoviewLayers = cgpv.api.maps?.LYR2?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR2').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR2?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR2?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR2.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField2.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField2.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField2.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField3 = document.getElementById('HLYR3-state'); - const geoviewLayers = cgpv.api.maps?.LYR3?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR3').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR3?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR3?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR3.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField3.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField3.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)';; } else displayField3.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/esri-feature.html b/packages/geoview-core/public/templates/layers/esri-feature.html index 68f33c92faf..014f3bc1467 100644 --- a/packages/geoview-core/public/templates/layers/esri-feature.html +++ b/packages/geoview-core/public/templates/layers/esri-feature.html @@ -406,37 +406,40 @@

3. Date filtering using ISO UTC dates

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR1.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField2 = document.getElementById('HLYR2-state'); - const geoviewLayers = cgpv.api.maps?.LYR2?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR2').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR2?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR2?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR2.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField2.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField2.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField2.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField3 = document.getElementById('HLYR3-state'); - const geoviewLayers = cgpv.api.maps?.LYR3?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR3').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR3?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR3?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR3.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField3.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField3.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField3.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/geocore.html b/packages/geoview-core/public/templates/layers/geocore.html index a0e11af06f9..b79b468e397 100644 --- a/packages/geoview-core/public/templates/layers/geocore.html +++ b/packages/geoview-core/public/templates/layers/geocore.html @@ -200,14 +200,14 @@

1. Many GeoCore Layers

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const layerName = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].geoviewLayerName.en; - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerName}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR1.layer.geoviewLayers[layerId.split('/')[0]].geoviewLayerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/geojson.html b/packages/geoview-core/public/templates/layers/geojson.html index 57bb37857b5..e2dae44c41e 100644 --- a/packages/geoview-core/public/templates/layers/geojson.html +++ b/packages/geoview-core/public/templates/layers/geojson.html @@ -248,13 +248,14 @@

1. Many GeoJSON Layers

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR1.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/geopackage.html b/packages/geoview-core/public/templates/layers/geopackage.html index a730ec5a8ca..9ee5986a427 100644 --- a/packages/geoview-core/public/templates/layers/geopackage.html +++ b/packages/geoview-core/public/templates/layers/geopackage.html @@ -232,25 +232,27 @@

2. Multiple GeoPackage Layers - one with multiple layers

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const layerName = cgpv.api.maps.LYR1.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField1 = document.getElementById('HLYR2-state'); - const geoviewLayers = cgpv.api.maps?.LYR2?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR2').resultSets; if (geoviewLayers) { const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const layerName = cgpv.api.maps.LYR2.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/image-static.html b/packages/geoview-core/public/templates/layers/image-static.html index 22cec22280c..4fe4fa7c884 100644 --- a/packages/geoview-core/public/templates/layers/image-static.html +++ b/packages/geoview-core/public/templates/layers/image-static.html @@ -159,13 +159,14 @@

1. Static Image Layers

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR1.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/ogc-feature.html b/packages/geoview-core/public/templates/layers/ogc-feature.html index dd4f0725210..c9d7d4c5a4f 100644 --- a/packages/geoview-core/public/templates/layers/ogc-feature.html +++ b/packages/geoview-core/public/templates/layers/ogc-feature.html @@ -164,13 +164,14 @@

1. OGC Feature API Layers

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR1.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/vector-tiles.html b/packages/geoview-core/public/templates/layers/vector-tiles.html index a5110f80839..07cb767f920 100644 --- a/packages/geoview-core/public/templates/layers/vector-tiles.html +++ b/packages/geoview-core/public/templates/layers/vector-tiles.html @@ -196,37 +196,42 @@

3. Vector Tiles olms library no GeoView

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.registeredLayers; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = geoviewLayers[layerId].layerName?.en ? geoviewLayers[layerId].layerName?.en : layerId; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField2 = document.getElementById('HLYR2-state'); - const geoviewLayers = cgpv.api.maps?.LYR2?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.maps?.LYR2?.layer?.registeredLayers; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR2?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR2?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = geoviewLayers[layerId].layerName?.en ? geoviewLayers[layerId].layerName?.en : layerId; + const {layerPhase} = geoviewLayers[layerId]; + const {layerStatus} = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField2.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField2.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField2.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField3 = document.getElementById('HLYR3-state'); - const geoviewLayers = cgpv.api.maps?.LYR3?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.maps?.LYR3?.layer?.registeredLayers; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR3?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR3?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = geoviewLayers[layerId].layerName?.en ? geoviewLayers[layerId].layerName?.en : layerId; + const {layerPhase} = geoviewLayers[layerId]; + const {layerStatus} = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField3.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField3.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField3.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/wfs.html b/packages/geoview-core/public/templates/layers/wfs.html index 9e15fbd64d1..9bcc2f0cd3d 100644 --- a/packages/geoview-core/public/templates/layers/wfs.html +++ b/packages/geoview-core/public/templates/layers/wfs.html @@ -225,25 +225,27 @@

2. WFS Layers using bbox strategy

window.setInterval(() => { const displayField1 = document.getElementById('HLYR1-state'); - const geoviewLayers = cgpv.api.maps?.LYR1?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR1').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR1?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR1?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR1.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField1.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField1.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField1.textContent = '(undefined)'; }, 250) window.setInterval(() => { const displayField2 = document.getElementById('HLYR2-state'); - const geoviewLayers = cgpv.api.maps?.LYR2?.layer?.geoviewLayers; + const geoviewLayers = cgpv.api.getFeatureInfoLayerSet('LYR2').resultSets; if (geoviewLayers) { - const output = Object.keys(cgpv.api.maps?.LYR2?.layer?.geoviewLayers).reduce((outputValue, layerId) => { - const stateValue = cgpv.api.maps?.LYR2?.layer?.geoviewLayers[layerId].layerPhase; - return `${outputValue}${layerId}: ${stateValue}, `; + const output = Object.keys(geoviewLayers).reduce((outputValue, layerId) => { + const layerName = cgpv.api.maps.LYR2.layer.registeredLayers[layerId].layerName.en; + const { layerPhase, layerStatus } = geoviewLayers[layerId]; + return `${outputValue}${layerName} - status: ${layerStatus}, phase: ${layerPhase}, `; }, '('); - displayField2.textContent = output ? `${output.slice(0, -2)})` : '(undefined)'; + displayField2.textContent = output && output !== '(' ? `${output.slice(0, -2)})` : '(undefined)'; } else displayField2.textContent = '(undefined)'; }, 250) diff --git a/packages/geoview-core/public/templates/layers/wms.html b/packages/geoview-core/public/templates/layers/wms.html index 97dadcd3972..6f8d731ddcf 100644 --- a/packages/geoview-core/public/templates/layers/wms.html +++ b/packages/geoview-core/public/templates/layers/wms.html @@ -14,14 +14,23 @@