Skip to content

Commit

Permalink
Bind default layout to print component
Browse files Browse the repository at this point in the history
  • Loading branch information
svaabs authored and llienher committed Mar 27, 2020
1 parent 6e0df41 commit 116ad94
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contribs/gmf/src/print/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ function gmfPrintTemplateUrl($element, $attrs, gmfPrintTemplateUrl) {
* property's name of the field.
* Example: {'comments': 'demo', 'legend': false}. Doesn't work for the dpi
* and the scale. Server's values are used in priority.
* @htmlAttribute {string} gmf-print-defaultlayout Optional. The default layout.
* @htmlAttribute {string[]} gmf-print-hiddenattributes The list of attributes that should be hidden.
* @ngdoc component
* @ngname gmfPrint
Expand All @@ -229,6 +230,7 @@ const printComponent = {
'rotateMask': '<?gmfPrintRotatemask',
'fieldValues': '<?gmfPrintFieldvalues',
'hiddenAttributeNames': '<?gmfPrintHiddenattributes',
'defaultLayout': '<?gmfPrintDefaultlayout',
'attributesOut': '=?gmfPrintAttributesOut'
},
controller: 'GmfPrintController',
Expand Down Expand Up @@ -328,6 +330,11 @@ export class PrintController {
*/
this.fieldValues = {};

/**
* @type {string}
*/
this.defaultLayout;

/**
* @type {import('ngeo/print/mapfish-print-v3').MapFishPrintCapabilitiesLayoutAttribute[]}
*/
Expand Down Expand Up @@ -716,6 +723,9 @@ export class PrintController {
// Get capabilities - On success
this.parseCapabilities_(resp);
this.map.addLayer(this.maskLayer_);
if (this.defaultLayout) {
this.setLayout(this.defaultLayout);
}
this.pointerDragListenerKey_ = listen(this.map, 'pointerdrag', this.onPointerDrag_, this);
this.mapViewResolutionChangeKey_ = listen(this.map.getView(), 'change:resolution', () => {
this.scaleManuallySelected_ = false;
Expand Down

0 comments on commit 116ad94

Please sign in to comment.