Move WriteOptions to ol/format/Feature

This commit is contained in:
Tim Schaub
2018-03-11 15:55:48 -06:00
parent 4eb6603af7
commit 8eaee5618e
15 changed files with 89 additions and 151 deletions

View File

@@ -5,66 +5,6 @@
let olx;
/**
* @typedef {{dataProjection: ol.ProjectionLike,
* featureProjection: ol.ProjectionLike,
* rightHanded: (boolean|undefined),
* decimals: (number|undefined)}}
*/
olx.format.WriteOptions;
/**
* Projection of the data we are writing. If not provided, the
* `defaultDataProjection` of the format is assigned (where set). If no
* `defaultDataProjection` is set for a format, the features will be returned
* in the `featureProjection`.
* @type {ol.ProjectionLike}
* @api
*/
olx.format.WriteOptions.prototype.dataProjection;
/**
* Projection of the feature geometries that will be serialized by the format
* writer. If not provided, geometries are assumed to be in the
* `dataProjection` if that is set; in other words, they are not transformed.
* @type {ol.ProjectionLike}
* @api
*/
olx.format.WriteOptions.prototype.featureProjection;
/**
* When writing geometries, follow the right-hand rule for linear ring
* orientation. This means that polygons will have counter-clockwise exterior
* rings and clockwise interior rings. By default, coordinates are serialized
* as they are provided at construction. If `true`, the right-hand rule will
* be applied. If `false`, the left-hand rule will be applied (clockwise for
* exterior and counter-clockwise for interior rings). Note that not all
* formats support this. The GeoJSON format does use this property when writing
* geometries.
*
* @type {boolean|undefined}
* @api
*/
olx.format.WriteOptions.prototype.rightHanded;
/**
* Maximum number of decimal places for coordinates. Coordinates are stored
* internally as floats, but floating-point arithmetic can create coordinates
* with a large number of decimal places, not generally wanted on output.
* Set a number here to round coordinates. Can also be used to ensure that
* coordinates read in can be written back out with the same number of decimals.
* Default is no rounding.
*
* @type {number|undefined}
* @api
*/
olx.format.WriteOptions.prototype.decimals;
/**
* @typedef {{defaultDataProjection: ol.ProjectionLike,
* geometryName: (string|undefined),

View File

@@ -1,32 +1,4 @@
/**
* @typedef {Object} format_WriteOptions
* @property {ol.ProjectionLike} dataProjection Projection of the data we are writing. If not provided, the
* `defaultDataProjection` of the format is assigned (where set). If no
* `defaultDataProjection` is set for a format, the features will be returned
* in the `featureProjection`.
* @property {ol.ProjectionLike} featureProjection Projection of the feature geometries that will be serialized by the format
* writer. If not provided, geometries are assumed to be in the
* `dataProjection` if that is set; in other words, they are not transformed.
* @property {boolean|undefined} rightHanded When writing geometries, follow the right-hand rule for linear ring
* orientation. This means that polygons will have counter-clockwise exterior
* rings and clockwise interior rings. By default, coordinates are serialized
* as they are provided at construction. If `true`, the right-hand rule will
* be applied. If `false`, the left-hand rule will be applied (clockwise for
* exterior and counter-clockwise for interior rings). Note that not all
* formats support this. The GeoJSON format does use this property when writing
* geometries.
*
* @property {number|undefined} decimals Maximum number of decimal places for coordinates. Coordinates are stored
* internally as floats, but floating-point arithmetic can create coordinates
* with a large number of decimal places, not generally wanted on output.
* Set a number here to round coordinates. Can also be used to ensure that
* coordinates read in can be written back out with the same number of decimals.
* Default is no rounding.
*
*/
/**
* @typedef {Object} format_GeoJSONOptions
* @property {ol.ProjectionLike} defaultDataProjection Default data projection. Default is `EPSG:4326`.

View File

@@ -37,7 +37,7 @@ GEOMETRY_READERS[GeometryType.MULTI_POLYGON] = readMultiPolygonGeometry;
/**
* @const
* @type {Object.<string, function(ol.geom.Geometry, olx.format.WriteOptions=): (EsriJSONGeometry)>}
* @type {Object.<string, function(ol.geom.Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
*/
const GEOMETRY_WRITERS = {};
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
@@ -261,7 +261,7 @@ function readPolygonGeometry(object) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONGeometry} EsriJSON geometry.
*/
function writePointGeometry(geometry, opt_options) {
@@ -316,7 +316,7 @@ function getHasZM(geometry) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONPolyline} EsriJSON geometry.
*/
function writeLineStringGeometry(geometry, opt_options) {
@@ -333,7 +333,7 @@ function writeLineStringGeometry(geometry, opt_options) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONPolygon} EsriJSON geometry.
*/
function writePolygonGeometry(geometry, opt_options) {
@@ -349,7 +349,7 @@ function writePolygonGeometry(geometry, opt_options) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONPolyline} EsriJSON geometry.
*/
function writeMultiLineStringGeometry(geometry, opt_options) {
@@ -364,7 +364,7 @@ function writeMultiLineStringGeometry(geometry, opt_options) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONMultipoint} EsriJSON geometry.
*/
function writeMultiPointGeometry(geometry, opt_options) {
@@ -379,7 +379,7 @@ function writeMultiPointGeometry(geometry, opt_options) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONPolygon} EsriJSON geometry.
*/
function writeMultiPolygonGeometry(geometry, opt_options) {
@@ -516,7 +516,7 @@ EsriJSON.prototype.readProjectionFromObject = function(object) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONGeometry} EsriJSON geometry.
*/
function writeGeometry(geometry, opt_options) {
@@ -531,7 +531,7 @@ function writeGeometry(geometry, opt_options) {
*
* @function
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} EsriJSON.
* @api
*/
@@ -542,7 +542,7 @@ EsriJSON.prototype.writeGeometry;
* Encode a geometry as a EsriJSON object.
*
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {EsriJSONGeometry} Object.
* @override
* @api
@@ -557,7 +557,7 @@ EsriJSON.prototype.writeGeometryObject = function(geometry, opt_options) {
*
* @function
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} EsriJSON.
* @api
*/
@@ -568,7 +568,7 @@ EsriJSON.prototype.writeFeature;
* Encode a feature as a esriJSON Feature object.
*
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} Object.
* @override
* @api
@@ -601,7 +601,7 @@ EsriJSON.prototype.writeFeatureObject = function(feature, opt_options) {
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} EsriJSON.
* @api
*/
@@ -612,7 +612,7 @@ EsriJSON.prototype.writeFeatures;
* Encode an array of features as a EsriJSON object.
*
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} EsriJSON Object.
* @override
* @api

View File

@@ -21,6 +21,32 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
*/
/**
* @typedef {Object} WriteOptions
* @property {ol.ProjectionLike} dataProjection Projection of the data we are writing.
* If not provided, the `defaultDataProjection` of the format is assigned (where set).
* If no `defaultDataProjection` is set for a format, the features will be returned
* in the `featureProjection`.
* @property {ol.ProjectionLike} featureProjection Projection of the feature geometries
* that will be serialized by the format writer. If not provided, geometries are assumed
* to be in the `dataProjection` if that is set; in other words, they are not transformed.
* @property {boolean|undefined} rightHanded When writing geometries, follow the right-hand
* rule for linear ring orientation. This means that polygons will have counter-clockwise
* exterior rings and clockwise interior rings. By default, coordinates are serialized
* as they are provided at construction. If `true`, the right-hand rule will
* be applied. If `false`, the left-hand rule will be applied (clockwise for
* exterior and counter-clockwise for interior rings). Note that not all
* formats support this. The GeoJSON format does use this property when writing
* geometries.
* @property {number|undefined} decimals Maximum number of decimal places for coordinates.
* Coordinates are stored internally as floats, but floating-point arithmetic can create
* coordinates with a large number of decimal places, not generally wanted on output.
* Set a number here to round coordinates. Can also be used to ensure that
* coordinates read in can be written back out with the same number of decimals.
* Default is no rounding.
*/
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
@@ -74,10 +100,10 @@ FeatureFormat.prototype.getReadOptions = function(source, opt_options) {
/**
* Sets the `defaultDataProjection` on the options, if no `dataProjection`
* is set.
* @param {olx.format.WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
* Options.
* @protected
* @return {olx.format.WriteOptions|module:ol/format/Feature~ReadOptions|undefined}
* @return {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined}
* Updated options.
*/
FeatureFormat.prototype.adaptOptions = function(options) {
@@ -152,7 +178,7 @@ FeatureFormat.prototype.readProjection = function(source) {};
*
* @abstract
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Result.
*/
FeatureFormat.prototype.writeFeature = function(feature, opt_options) {};
@@ -163,7 +189,7 @@ FeatureFormat.prototype.writeFeature = function(feature, opt_options) {};
*
* @abstract
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Result.
*/
FeatureFormat.prototype.writeFeatures = function(features, opt_options) {};
@@ -174,7 +200,7 @@ FeatureFormat.prototype.writeFeatures = function(features, opt_options) {};
*
* @abstract
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Result.
*/
FeatureFormat.prototype.writeGeometry = function(geometry, opt_options) {};
@@ -184,7 +210,7 @@ export default FeatureFormat;
/**
* @param {ol.geom.Geometry|module:ol/extent~Extent} geometry Geometry.
* @param {boolean} write Set to true for writing, false for reading.
* @param {(olx.format.WriteOptions|module:ol/format/Feature~ReadOptions)=} opt_options
* @param {(module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions)=} opt_options
* Options.
* @return {ol.geom.Geometry|module:ol/extent~Extent} Transformed geometry.
*/

View File

@@ -23,7 +23,7 @@ const GML = GML3;
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {string} Result.
* @api
*/
@@ -35,7 +35,7 @@ GML.prototype.writeFeatures;
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {Node} Node.
* @api
*/

View File

@@ -282,7 +282,7 @@ GML2.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectSta
* @param {Array.<*>} objectStack Node stack.
*/
GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
const context = /** @type {olx.format.WriteOptions} */ (objectStack[objectStack.length - 1]);
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
const item = assign({}, context);
item.node = node;
let value;

View File

@@ -940,7 +940,7 @@ GML3.prototype.writeCurveSegments_ = function(node, line, objectStack) {
* @param {Array.<*>} objectStack Node stack.
*/
GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
const context = /** @type {olx.format.WriteOptions} */ (objectStack[objectStack.length - 1]);
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
const item = assign({}, context);
item.node = node;
let value;
@@ -1097,7 +1097,7 @@ GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeNam
* Encode a geometry in GML 3.1.1 Simple Features.
*
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {Node} Node.
* @override
* @api
@@ -1121,7 +1121,7 @@ GML3.prototype.writeGeometryNode = function(geometry, opt_options) {
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {string} Result.
* @api
*/
@@ -1132,7 +1132,7 @@ GML3.prototype.writeFeatures;
* Encode an array of features in the GML 3.1.1 format as an XML node.
*
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {Node} Node.
* @override
* @api

View File

@@ -768,7 +768,7 @@ function writeWptType(node, coordinate, objectStack) {
* @param {Array.<*>} objectStack Object stack.
*/
function writeRte(node, feature, objectStack) {
const options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
const properties = feature.getProperties();
const context = {node: node, 'properties': properties};
let geometry = feature.getGeometry();
@@ -792,7 +792,7 @@ function writeRte(node, feature, objectStack) {
* @param {Array.<*>} objectStack Object stack.
*/
function writeTrk(node, feature, objectStack) {
const options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
const properties = feature.getProperties();
/** @type {module:ol/xml~NodeStackItem} */
const context = {node: node, 'properties': properties};
@@ -832,7 +832,7 @@ function writeTrkSeg(node, lineString, objectStack) {
* @param {Array.<*>} objectStack Object stack.
*/
function writeWpt(node, feature, objectStack) {
const options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
const context = objectStack[objectStack.length - 1];
context['properties'] = feature.getProperties();
let geometry = feature.getGeometry();
@@ -852,7 +852,7 @@ function writeWpt(node, feature, objectStack) {
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Result.
* @api
*/
@@ -865,7 +865,7 @@ GPX.prototype.writeFeatures;
* as tracks (`<trk>`).
*
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {Node} Node.
* @override
* @api

View File

@@ -82,7 +82,7 @@ const GEOMETRY_READERS = {
/**
* @const
* @type {Object.<string, function(ol.geom.Geometry, olx.format.WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
* @type {Object.<string, function(ol.geom.Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
*/
const GEOMETRY_WRITERS = {
'Point': writePointGeometry,
@@ -186,7 +186,7 @@ function readPolygonGeometry(object) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} GeoJSON geometry.
*/
function writeGeometry(geometry, opt_options) {
@@ -210,7 +210,7 @@ function writeEmptyGeometryCollectionGeometry(geometry) {
/**
* @param {ol.geom.GeometryCollection} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
*/
function writeGeometryCollectionGeometry(geometry, opt_options) {
@@ -228,7 +228,7 @@ function writeGeometryCollectionGeometry(geometry, opt_options) {
/**
* @param {ol.geom.LineString} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
function writeLineStringGeometry(geometry, opt_options) {
@@ -241,7 +241,7 @@ function writeLineStringGeometry(geometry, opt_options) {
/**
* @param {ol.geom.MultiLineString} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
function writeMultiLineStringGeometry(geometry, opt_options) {
@@ -254,7 +254,7 @@ function writeMultiLineStringGeometry(geometry, opt_options) {
/**
* @param {ol.geom.MultiPoint} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
function writeMultiPointGeometry(geometry, opt_options) {
@@ -267,7 +267,7 @@ function writeMultiPointGeometry(geometry, opt_options) {
/**
* @param {ol.geom.MultiPolygon} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
function writeMultiPolygonGeometry(geometry, opt_options) {
@@ -284,7 +284,7 @@ function writeMultiPolygonGeometry(geometry, opt_options) {
/**
* @param {ol.geom.Point} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
function writePointGeometry(geometry, opt_options) {
@@ -297,7 +297,7 @@ function writePointGeometry(geometry, opt_options) {
/**
* @param {ol.geom.Polygon} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry} GeoJSON geometry.
*/
function writePolygonGeometry(geometry, opt_options) {
@@ -453,7 +453,7 @@ GeoJSON.prototype.readProjectionFromObject = function(object) {
*
* @function
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} GeoJSON.
* @override
* @api
@@ -465,7 +465,7 @@ GeoJSON.prototype.writeFeature;
* Encode a feature as a GeoJSON Feature object.
*
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONFeature} Object.
* @override
* @api
@@ -502,7 +502,7 @@ GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} GeoJSON.
* @api
*/
@@ -513,7 +513,7 @@ GeoJSON.prototype.writeFeatures;
* Encode an array of features as a GeoJSON object.
*
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONFeatureCollection} GeoJSON Object.
* @override
* @api
@@ -536,7 +536,7 @@ GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) {
*
* @function
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} GeoJSON.
* @api
*/
@@ -547,7 +547,7 @@ GeoJSON.prototype.writeGeometry;
* Encode a geometry as a GeoJSON object.
*
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
* @override
* @api

View File

@@ -131,7 +131,7 @@ JSONFeature.prototype.writeFeature = function(feature, opt_options) {
/**
* @abstract
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} Object.
*/
JSONFeature.prototype.writeFeatureObject = function(feature, opt_options) {};
@@ -148,7 +148,7 @@ JSONFeature.prototype.writeFeatures = function(features, opt_options) {
/**
* @abstract
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} Object.
*/
JSONFeature.prototype.writeFeaturesObject = function(features, opt_options) {};
@@ -165,7 +165,7 @@ JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
/**
* @abstract
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} Object.
*/
JSONFeature.prototype.writeGeometryObject = function(geometry, opt_options) {};

View File

@@ -2698,7 +2698,7 @@ function writePlacemark(node, feature, objectStack) {
OBJECT_PROPERTY_NODE_FACTORY, values, objectStack, orderedKeys);
// serialize geometry
const options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
let geometry = feature.getGeometry();
if (geometry) {
geometry = transformWithOptions(geometry, true, options);
@@ -2940,7 +2940,7 @@ const KML_SERIALIZERS = makeStructureNS(
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {string} Result.
* @api
*/
@@ -2952,7 +2952,7 @@ KML.prototype.writeFeatures;
* MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.
*
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {Node} Node.
* @override
* @api

View File

@@ -366,7 +366,7 @@ Polyline.prototype.writeFeaturesText = function(features, opt_options) {
*
* @function
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Geometry.
* @api
*/

View File

@@ -126,7 +126,7 @@ TextFeature.prototype.writeFeature = function(feature, opt_options) {
/**
* @abstract
* @param {ol.Feature} feature Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @protected
* @return {string} Text.
*/
@@ -144,7 +144,7 @@ TextFeature.prototype.writeFeatures = function(features, opt_options) {
/**
* @abstract
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @protected
* @return {string} Text.
*/
@@ -162,7 +162,7 @@ TextFeature.prototype.writeGeometry = function(geometry, opt_options) {
/**
* @abstract
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @protected
* @return {string} Text.
*/

View File

@@ -856,7 +856,7 @@ Parser.prototype.parseGeometry_ = function() {
*
* @function
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} WKT string.
* @api
*/
@@ -880,7 +880,7 @@ WKT.prototype.writeFeatureText = function(feature, opt_options) {
*
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} WKT string.
* @api
*/
@@ -908,7 +908,7 @@ WKT.prototype.writeFeaturesText = function(features, opt_options) {
*
* @function
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} WKT string.
* @api
*/

View File

@@ -215,7 +215,7 @@ XMLFeature.prototype.writeFeature = function(feature, opt_options) {
/**
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @protected
* @return {Node} Node.
*/
@@ -235,7 +235,7 @@ XMLFeature.prototype.writeFeatures = function(features, opt_options) {
/**
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {Node} Node.
*/
XMLFeature.prototype.writeFeaturesNode = function(features, opt_options) {
@@ -254,7 +254,7 @@ XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
/**
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Options.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
* @return {Node} Node.
*/
XMLFeature.prototype.writeGeometryNode = function(geometry, opt_options) {