Skip to content

Commit

Permalink
Merge pull request #4114 from camptocamp/qgis
Browse files Browse the repository at this point in the history
Qgis print legend - Fix bbox, add the DPI
  • Loading branch information
sbrunner committed Aug 10, 2018
2 parents d194594 + 591c301 commit ccd47b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions contribs/gmf/src/print/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,7 @@ exports.Controller_ = class {
if (icons) {
classes.push({
'name': gettextCatalog.getString(layerName),
'dpi': dpi,
'icons': [icons]
});
}
Expand All @@ -1131,6 +1132,7 @@ exports.Controller_ = class {
if (icons && name.length !== 0) {
classes.push({
'name': gettextCatalog.getString(name),
'dpi': dpi,
'icons': [icons]
});
}
Expand Down
4 changes: 3 additions & 1 deletion src/map/LayerHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,11 @@ exports.prototype.getWMSLegendURL = function(url,
if (opt_dpi != undefined) {
queryString['DPI'] = opt_dpi;
}
if (opt_bbox != undefined && opt_srs != undefined) {
if (opt_bbox != undefined && opt_srs != undefined && opt_scale != undefined && opt_dpi != undefined && opt_legendRule == undefined) {
queryString['BBOX'] = opt_bbox.join(',');
queryString['SRS'] = opt_srs;
queryString['WIDTH'] = Math.round((opt_bbox[2] - opt_bbox[0]) / opt_scale * 39.37 * opt_dpi);
queryString['HEIGHT'] = Math.round((opt_bbox[3] - opt_bbox[1]) / opt_scale * 39.37 * opt_dpi);
}
}
return olUri.appendParams(url, queryString);
Expand Down

0 comments on commit ccd47b7

Please sign in to comment.