From b0d95b326a6962d197e8e8f9a061c805db0b01e5 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Fri, 18 Jul 2014 20:49:12 +0200 Subject: [PATCH] Introduce WriteOptions for feature formats --- externs/olx.js | 22 +++++++++++++++++++++- src/ol/format/featureformat.js | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/externs/olx.js b/externs/olx.js index b0fd30c027..16af4ed0c2 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -1167,6 +1167,27 @@ olx.format.ReadOptions.prototype.dataProjection; olx.format.ReadOptions.prototype.featureProjection; +/** + * @typedef {{dataProjection: (ol.proj.ProjectionLike|undefined), + * featureProjection: ol.proj.ProjectionLike}} + */ +olx.format.WriteOptions; + + +/** + * Projection of the data we are writing. Default is the `featureProjection`. + * @type {ol.proj.ProjectionLike|undefined} + */ +olx.format.WriteOptions.prototype.dataProjection; + + +/** + * Projection of the feature geometries serialized by the format writer. + * @type {ol.proj.ProjectionLike} + */ +olx.format.WriteOptions.prototype.featureProjection; + + /** * @typedef {{defaultProjection: ol.proj.ProjectionLike, * geometryName: (string|undefined)}} @@ -1203,7 +1224,6 @@ olx.format.PolylineOptions; olx.format.PolylineOptions.prototype.factor; - /** * @typedef {{defaultProjection: ol.proj.ProjectionLike}} * @api diff --git a/src/ol/format/featureformat.js b/src/ol/format/featureformat.js index c466747771..83ae7e6c18 100644 --- a/src/ol/format/featureformat.js +++ b/src/ol/format/featureformat.js @@ -74,6 +74,7 @@ ol.format.Feature.prototype.readProjection = goog.abstractMethod; * Encode a feature in this format. * * @param {ol.Feature} feature Feature. + * @param {olx.format.WriteOptions=} opt_options Write options. * @return {ArrayBuffer|Node|Object|string} Result. */ ol.format.Feature.prototype.writeFeature = goog.abstractMethod; @@ -83,6 +84,7 @@ ol.format.Feature.prototype.writeFeature = goog.abstractMethod; * Encode an array of features in this format. * * @param {Array.} features Features. + * @param {olx.format.WriteOptions=} opt_options Write options. * @return {ArrayBuffer|Node|Object|string} Result. */ ol.format.Feature.prototype.writeFeatures = goog.abstractMethod; @@ -92,6 +94,7 @@ ol.format.Feature.prototype.writeFeatures = goog.abstractMethod; * Write a single geometry in this format. * * @param {ol.geom.Geometry} geometry Geometry. + * @param {olx.format.WriteOptions=} opt_options Write options. * @return {ArrayBuffer|Node|Object|string} Node. */ ol.format.Feature.prototype.writeGeometry = goog.abstractMethod;