diff --git a/contribs/gmf/options/gmfx.js b/contribs/gmf/options/gmfx.js index 0363cbd4ee5e..13d0ea51ac44 100644 --- a/contribs/gmf/options/gmfx.js +++ b/contribs/gmf/options/gmfx.js @@ -297,6 +297,7 @@ gmfx.PermalinkOptions.prototype.pointRecenterZoom * of the gmf print panel. * @typedef {{ * simpleAttributes: (Array.|undefined), + * attributes: (Array), * dpi: (number|undefined), * dpis: (Array.|undefined), * formats: (Object.|undefined), diff --git a/contribs/gmf/src/print/component.js b/contribs/gmf/src/print/component.js index a861e3d7e2fa..1ecf14d4dc14 100644 --- a/contribs/gmf/src/print/component.js +++ b/contribs/gmf/src/print/component.js @@ -721,11 +721,15 @@ exports.Controller_ = class { if (!this.layoutInfo.simpleAttributes) { this.layoutInfo.simpleAttributes = []; } + if (!this.layoutInfo.attributes) { + this.layoutInfo.attributes = []; + } const simpleAttributes = this.layoutInfo.simpleAttributes; const previousAttributes = simpleAttributes.splice(0, simpleAttributes.length); // The attributes without 'clientParams' are the custom layout information (defined by end user). this.layout_.attributes.forEach((attribute) => { + this.layoutInfo.attributes.push(attribute.name); if (!attribute['clientParams']) { name = `${attribute.name}`; const defaultValue = attribute.default; @@ -869,9 +873,11 @@ exports.Controller_ = class { const scale = this.layoutInfo.scale || this.getOptimalScale_(mapSize, viewResolution); const datasource = this.getDataSource_(); - const customAttributes = { - 'datasource': datasource - }; + const customAttributes = {}; + + if (this.layoutInfo.attributes.indexOf('datasource') >= 0) { + customAttributes['datasource'] = datasource; + } if (this.layoutInfo.simpleAttributes) { this.layoutInfo.simpleAttributes.forEach((field) => {