From f0779513b7d40db63605b817c23e651cd1f3d67b Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 3 Apr 2019 09:44:17 +0200 Subject: [PATCH] Allow overriding vector encoder --- src/print/Service.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/print/Service.js b/src/print/Service.js index 2a4b7c72cea8..182b52fa405e 100644 --- a/src/print/Service.js +++ b/src/print/Service.js @@ -87,9 +87,9 @@ const exports = function(url, $http, gettextCatalog, ngeoLayerHelper) { /** * @type {ngeo.print.VectorEncoder} - * @private + * @protected */ - this.vectorEncoder_ = new ngeoPrintVectorEncoder(); + this.vectorEncoder = new ngeoPrintVectorEncoder(); /** * @type {boolean} @@ -205,10 +205,18 @@ exports.prototype.encodeLayer = function(arr, layer, resolution) { } else if (layer instanceof olLayerTile) { this.encodeTileLayer_(arr, layer); } else if (layer instanceof olLayerVector) { - this.vectorEncoder_.encodeVectorLayer(arr, layer, resolution); + this.encodeVectorLayer(arr, layer, resolution); } }; +/** + * @param {Array.} arr Array. + * @param {ol.layer.Vector} layer Layer. + * @param {number} resolution Resolution. + */ +exports.prototype.encodeVectorLayer = function(arr, layer, resolution) { + this.vectorEncoder.encodeVectorLayer(arr, layer, resolution); +}; /** * @param {Array.} arr Array.