Skip to content

Commit

Permalink
Merge pull request #4625 from camptocamp/default_legend
Browse files Browse the repository at this point in the history
Can set rotate maske and disable legend per default
  • Loading branch information
ger-benjamin committed Feb 11, 2019
2 parents 7c5e793 + de9b543 commit 625436c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions contribs/gmf/src/directives/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ gmf.PrintController = function($element, $rootScope, $scope, $timeout, $q, $inje
* @type {boolean}
* @private
*/
this.rotateMask_ = this['rotateMask'] ? this['rotateMask']() : false;
this.rotateMask_ = false;

/**
* @type {Object.<string, string|number|boolean>!}
* @private
*/
this.fieldValues_ = this['fieldValues'] ?
this['fieldValues']() : {};
this.fieldValues_ = {};

/**
* @type {angular.Scope}
Expand Down Expand Up @@ -472,6 +471,15 @@ gmf.PrintController = function($element, $rootScope, $scope, $timeout, $q, $inje
};


/**
* Init the controller
*/
gmf.PrintController.prototype.$onInit = function() {
this.rotateMask_ = this['rotateMask'] ? this['rotateMask']() : false;
this.fieldValues_ = this['fieldValues'] ? this['fieldValues']() : {};
};


/**
* @param {boolean} active True to listen events related to the print and get
* capabilities. False to stop listen them and set rotation to 0.
Expand Down Expand Up @@ -572,11 +580,7 @@ gmf.PrintController.prototype.updateFields_ = function() {

this.updateCustomFields_();

const legend = this.isAttributeInCurrentLayout_('legend');
if (this.layoutInfo.legend === undefined) {
this.layoutInfo.legend = !!(legend !== undefined ?
legend : this.fieldValues_['legend']);
}
this.layoutInfo.legend = this.fieldValues_['legend'] !== false;

this.layoutInfo.scales = clientInfo['scales'] || [];
this.layoutInfo.dpis = clientInfo['dpiSuggestions'] || [];
Expand Down

0 comments on commit 625436c

Please sign in to comment.