Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding vector encoder #4793

Merged
merged 1 commit into from
Apr 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/print/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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.<MapFishPrintLayer>} 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.<MapFishPrintLayer>} arr Array.
Expand Down