From df8a50834283ce887d8254d2b6a595e458fa523c Mon Sep 17 00:00:00 2001 From: velomovies <22169955+velomovies@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:19:43 +0100 Subject: [PATCH 1/2] fix(LegendPanel): only use legendImageSrc if everything is defined --- src/components/LegendPanel.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/LegendPanel.vue b/src/components/LegendPanel.vue index 03f71825..587d9e66 100644 --- a/src/components/LegendPanel.vue +++ b/src/components/LegendPanel.vue @@ -134,9 +134,10 @@ export default { const styleName = layer.legend.style; const layerId = layer.legend.layer; const url = this.services && this.services.LEGEND_URL; - legendImageSrc = url - ? `${url}/${namespace}/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&LAYER=${layerId}&STYLE=${styleName}&HEIGHT=16&WIDTH=16&LEGEND_OPTIONS=fontAntiAliasing:true;fontSize:14;mx:0;dx:10;fontName:Verdana;` - : ''; + legendImageSrc = + url && namespace && styleName && layerId + ? `${url}/${namespace}/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&LAYER=${layerId}&STYLE=${styleName}&HEIGHT=16&WIDTH=16&LEGEND_OPTIONS=fontAntiAliasing:true;fontSize:14;mx:0;dx:10;fontName:Verdana;` + : ''; } return { From 049564122aeb873cf135c9f9b4a49138ad5014ec Mon Sep 17 00:00:00 2001 From: velomovies <22169955+velomovies@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:19:59 +0100 Subject: [PATCH 2/2] fix(load-breach): make sure content is correct --- src/lib/load-breach.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/load-breach.js b/src/lib/load-breach.js index 4eff2407..cdee61ac 100644 --- a/src/lib/load-breach.js +++ b/src/lib/load-breach.js @@ -69,7 +69,7 @@ export async function computeCombinedScenario (scenarioIds, band, layerSetId) { bands = _.filter(bands) // convert bands to layerlike objects - const layers = _.map(bands, (band) => { + const layers = bands.map((band) => { // if it looks like a layer, then it is a layer // lookup the translation const bandNl = _.get(BREACH_LAYERS_EN, band.band) @@ -78,7 +78,8 @@ export async function computeCombinedScenario (scenarioIds, band, layerSetId) { band.metadata = _.clone(band) band.map = { type: 'tile', - url: band.url + url: band.url, + namespace: 'LIWO_MEGO', } const layer = { id: band.mapid, @@ -86,7 +87,6 @@ export async function computeCombinedScenario (scenarioIds, band, layerSetId) { title: title, legend: { title: 'Gecombineerd Scenario [-]', - namespace: 'LIWO_MEGO' } } return layer