Skip to content

Commit

Permalink
Merge pull request #615 from Deltares-research/LIWO-982-legend-in-com…
Browse files Browse the repository at this point in the history
…bine-scenerio

Liwo 982 legend in combine scenario
  • Loading branch information
velomovies authored Jan 10, 2025
2 parents d16dcfa + 0495641 commit 9cf7f8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/components/LegendPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/load-breach.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -78,15 +78,15 @@ 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,
variants: [band],
title: title,
legend: {
title: 'Gecombineerd Scenario [-]',
namespace: 'LIWO_MEGO'
}
}
return layer
Expand Down

0 comments on commit 9cf7f8e

Please sign in to comment.