From ae14a59114779f7d2471ee17c28b1960139707f2 Mon Sep 17 00:00:00 2001 From: Riccardo Mari Date: Mon, 12 Dec 2016 11:45:38 +0100 Subject: [PATCH] Small fixes about layer params and print (qgis and mapserver case) --- web/client/components/TOC/fragments/legend/Legend.jsx | 1 + web/client/plugins/Save.jsx | 4 +++- web/client/plugins/SaveAs.jsx | 4 +++- web/client/utils/PrintUtils.js | 7 ++++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/client/components/TOC/fragments/legend/Legend.jsx b/web/client/components/TOC/fragments/legend/Legend.jsx index 9b1db999d3..7f29744308 100644 --- a/web/client/components/TOC/fragments/legend/Legend.jsx +++ b/web/client/components/TOC/fragments/legend/Legend.jsx @@ -41,6 +41,7 @@ const Legend = React.createClass({ LEGEND_OPTIONS: this.props.legendOptions // SCALE TODO }, layer.legendParams || {}, + layer.params || {}, layer.params && layer.params.SLD_BODY ? {SLD_BODY: layer.params.SLD_BODY} : {}); SecurityUtils.addAuthenticationParameter(url, query); diff --git a/web/client/plugins/Save.jsx b/web/client/plugins/Save.jsx index 809db226b8..93186e7e7c 100644 --- a/web/client/plugins/Save.jsx +++ b/web/client/plugins/Save.jsx @@ -100,7 +100,9 @@ const Save = React.createClass({ type: layer.type, url: layer.url, bbox: layer.bbox, - visibility: layer.visibility + visibility: layer.visibility, + singleTile: layer.singleTile || false, + ...assign({}, layer.params ? {params: layer.params} : {}) }; }); // Groups are ignored, as they already are defined in the layers diff --git a/web/client/plugins/SaveAs.jsx b/web/client/plugins/SaveAs.jsx index d908c4c4c6..fe84e42f58 100644 --- a/web/client/plugins/SaveAs.jsx +++ b/web/client/plugins/SaveAs.jsx @@ -132,7 +132,9 @@ const SaveAs = React.createClass({ type: layer.type, url: layer.url, bbox: layer.bbox, - visibility: layer.visibility + visibility: layer.visibility, + singleTile: layer.singleTile || false, + ...assign({}, layer.params ? {params: layer.params} : {}) }; }); // Groups are ignored, as they already are defined in the layers diff --git a/web/client/utils/PrintUtils.js b/web/client/utils/PrintUtils.js index 9aa9ab4be1..4ae3ac64a7 100644 --- a/web/client/utils/PrintUtils.js +++ b/web/client/utils/PrintUtils.js @@ -106,7 +106,7 @@ const PrintUtils = { "layers": [ layer.name ], - "format": layer.format || "image/jpeg", + "format": layer.format || "image/png", "styles": [ layer.style || '' ], @@ -123,7 +123,7 @@ const PrintUtils = { { "name": "", "icons": [ - (isArray(layer.url) ? layer.url[0] : layer.url) + url.format({ + PrintUtils.normalizeUrl(layer.url) + url.format({ query: { TRANSPARENT: true, EXCEPTIONS: "application/vnd.ogc.se_xml", @@ -137,7 +137,8 @@ const PrintUtils = { minSymbolSize: spec.iconSize, fontFamily: spec.fontFamily, LEGEND_OPTIONS: "forceLabels:" + (spec.forceLabels ? "on" : "") + ";fontAntialiasing:" + spec.antiAliasing + ";dpi:" + spec.legendDpi + ";fontStyle:" + (spec.bold && "bold" || (spec.italic && "italic") || ''), - format: "image/png" + format: "image/png", + ...assign({}, layer.params) } }) ]