diff --git a/contribs/gmf/src/print/component.js b/contribs/gmf/src/print/component.js index 1ecf14d4dc14..08ef9a5677b9 100644 --- a/contribs/gmf/src/print/component.js +++ b/contribs/gmf/src/print/component.js @@ -923,7 +923,12 @@ exports.Controller_ = class { server.url, layer_names, server.imageType, - server.type + server.type, + undefined, + undefined, + undefined, + undefined, + {opacity: ol_layers.opacity} ); layer.setZIndex(-200); } else { diff --git a/src/map/LayerHelper.js b/src/map/LayerHelper.js index 08170432d3c5..3f8719f9f28d 100644 --- a/src/map/LayerHelper.js +++ b/src/map/LayerHelper.js @@ -73,12 +73,14 @@ exports.REFRESH_PARAM = 'random'; * @param {string=} opt_time time parameter for layer queryable by time/periode * @param {Object.=} opt_params WMS parameters. * @param {string=} opt_crossOrigin crossOrigin. - * @param {Object=} opt_customOptions Some initial options. + * @param {Object=} opt_customSourceOptions Some initial options. + * @param {Object=} opt_customLayerOptions The layer opacity. * @return {ol.layer.Image} WMS Layer. * @export */ exports.prototype.createBasicWMSLayer = function(sourceURL, - sourceLayersName, sourceFormat, opt_serverType, opt_time, opt_params, opt_crossOrigin, opt_customOptions) { + sourceLayersName, sourceFormat, opt_serverType, opt_time, opt_params, opt_crossOrigin, + opt_customSourceOptions, opt_customLayerOptions) { const params = { 'FORMAT': sourceFormat, @@ -93,7 +95,7 @@ exports.prototype.createBasicWMSLayer = function(sourceURL, // OpenLayers expects 'qgis' insteads of 'qgisserver' olServerType = opt_serverType.replace('qgisserver', 'qgis'); } - const options = Object.assign({}, opt_customOptions, { + const options = Object.assign({}, opt_customSourceOptions, { url: sourceURL, params: params, serverType: olServerType, @@ -104,7 +106,8 @@ exports.prototype.createBasicWMSLayer = function(sourceURL, source.updateParams(opt_params); } - return new olLayerImage({source}); + const layerOptions = Object.assign({}, opt_customLayerOptions, {source}); + return new olLayerImage(layerOptions); };