Skip to content

Commit

Permalink
fix(LegendPanel): only use legendImageSrc if everything is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
velomovies committed Jan 10, 2025
1 parent 936123a commit df8a508
Showing 1 changed file with 4 additions and 3 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

0 comments on commit df8a508

Please sign in to comment.