Skip to content

Commit

Permalink
Merge pull request #1853 from origo-map/print-legend-icon
Browse files Browse the repository at this point in the history
fix: bad url for icon in print legend
  • Loading branch information
johnnyblasta authored Oct 16, 2023
2 parents 4802902 + 891cc4e commit fe8f679
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controls/print/print-legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ const LayerRow = function LayerRow(options) {
const layerName = aLayer.get('name');
const style = viewer.getStyle(aLayer.get('styleName'));
if (style && style[0] && style[0][0] && style[0][0].icon) {
return `${style[0][0].icon.src}&format=${format}`;
if (style[0][0].icon.src.includes('?')) {
return `${style[0][0].icon.src}&format=${format}`;
}
return `${style[0][0].icon.src}?format=${format}`;
}
return `${url}?SERVICE=WMS&layer=${layerName}&format=${format}&version=1.1.1&request=getLegendGraphic&scale=401&legend_options=dpi:300`;
};
Expand Down

0 comments on commit fe8f679

Please sign in to comment.