Move jsdoc constructor comments

This commit is contained in:
Frederic Junod
2018-07-17 10:20:26 +02:00
parent f2d0b11d24
commit 540b1793e7
23 changed files with 259 additions and 238 deletions

View File

@@ -58,12 +58,14 @@ GEOMETRY_WRITERS[GeometryType.MULTI_POLYGON] = writeMultiPolygonGeometry;
* @classdesc * @classdesc
* Feature format for reading and writing data in the EsriJSON format. * Feature format for reading and writing data in the EsriJSON format.
* *
* @constructor
* @extends {module:ol/format/JSONFeature} * @extends {module:ol/format/JSONFeature}
* @param {module:ol/format/EsriJSON~Options=} opt_options Options.
* @api * @api
*/ */
class EsriJSON { class EsriJSON {
/**
* @param {module:ol/format/EsriJSON~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -56,7 +56,6 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
* {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial * {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
* file formats. See the documentation for each format for more details. * file formats. See the documentation for each format for more details.
* *
* @constructor
* @abstract * @abstract
* @api * @api
*/ */
@@ -64,26 +63,26 @@ class FeatureFormat {
constructor() { constructor() {
/** /**
* @protected * @protected
* @type {module:ol/proj/Projection} * @type {module:ol/proj/Projection}
*/ */
this.dataProjection = null; this.dataProjection = null;
/** /**
* @protected * @protected
* @type {module:ol/proj/Projection} * @type {module:ol/proj/Projection}
*/ */
this.defaultFeatureProjection = null; this.defaultFeatureProjection = null;
} }
/** /**
* Adds the data projection to the read options. * Adds the data projection to the read options.
* @param {Document|Node|Object|string} source Source. * @param {Document|Node|Object|string} source Source.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
* @return {module:ol/format/Feature~ReadOptions|undefined} Options. * @return {module:ol/format/Feature~ReadOptions|undefined} Options.
* @protected * @protected
*/ */
getReadOptions(source, opt_options) { getReadOptions(source, opt_options) {
let options; let options;
if (opt_options) { if (opt_options) {
@@ -97,14 +96,14 @@ class FeatureFormat {
} }
/** /**
* Sets the `dataProjection` on the options, if no `dataProjection` * Sets the `dataProjection` on the options, if no `dataProjection`
* is set. * is set.
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options * @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
* Options. * Options.
* @protected * @protected
* @return {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} * @return {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined}
* Updated options. * Updated options.
*/ */
adaptOptions(options) { adaptOptions(options) {
return assign({ return assign({
dataProjection: this.dataProjection, dataProjection: this.dataProjection,
@@ -113,86 +112,86 @@ class FeatureFormat {
} }
/** /**
* Get the extent from the source of the last {@link readFeatures} call. * Get the extent from the source of the last {@link readFeatures} call.
* @return {module:ol/extent~Extent} Tile extent. * @return {module:ol/extent~Extent} Tile extent.
*/ */
getLastExtent() { getLastExtent() {
return null; return null;
} }
/** /**
* @abstract * @abstract
* @return {module:ol/format/FormatType} Format. * @return {module:ol/format/FormatType} Format.
*/ */
getType() {} getType() {}
/** /**
* Read a single feature from a source. * Read a single feature from a source.
* *
* @abstract * @abstract
* @param {Document|Node|Object|string} source Source. * @param {Document|Node|Object|string} source Source.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @return {module:ol/Feature} Feature. * @return {module:ol/Feature} Feature.
*/ */
readFeature(source, opt_options) {} readFeature(source, opt_options) {}
/** /**
* Read all features from a source. * Read all features from a source.
* *
* @abstract * @abstract
* @param {Document|Node|ArrayBuffer|Object|string} source Source. * @param {Document|Node|ArrayBuffer|Object|string} source Source.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @return {Array.<module:ol/Feature>} Features. * @return {Array.<module:ol/Feature>} Features.
*/ */
readFeatures(source, opt_options) {} readFeatures(source, opt_options) {}
/** /**
* Read a single geometry from a source. * Read a single geometry from a source.
* *
* @abstract * @abstract
* @param {Document|Node|Object|string} source Source. * @param {Document|Node|Object|string} source Source.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @return {module:ol/geom/Geometry} Geometry. * @return {module:ol/geom/Geometry} Geometry.
*/ */
readGeometry(source, opt_options) {} readGeometry(source, opt_options) {}
/** /**
* Read the projection from a source. * Read the projection from a source.
* *
* @abstract * @abstract
* @param {Document|Node|Object|string} source Source. * @param {Document|Node|Object|string} source Source.
* @return {module:ol/proj/Projection} Projection. * @return {module:ol/proj/Projection} Projection.
*/ */
readProjection(source) {} readProjection(source) {}
/** /**
* Encode a feature in this format. * Encode a feature in this format.
* *
* @abstract * @abstract
* @param {module:ol/Feature} feature Feature. * @param {module:ol/Feature} feature Feature.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Result. * @return {string} Result.
*/ */
writeFeature(feature, opt_options) {} writeFeature(feature, opt_options) {}
/** /**
* Encode an array of features in this format. * Encode an array of features in this format.
* *
* @abstract * @abstract
* @param {Array.<module:ol/Feature>} features Features. * @param {Array.<module:ol/Feature>} features Features.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Result. * @return {string} Result.
*/ */
writeFeatures(features, opt_options) {} writeFeatures(features, opt_options) {}
/** /**
* Write a single geometry in this format. * Write a single geometry in this format.
* *
* @abstract * @abstract
* @param {module:ol/geom/Geometry} geometry Geometry. * @param {module:ol/geom/Geometry} geometry Geometry.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {string} Result. * @return {string} Result.
*/ */
writeGeometry(geometry, opt_options) {} writeGeometry(geometry, opt_options) {}
} }

View File

@@ -37,12 +37,14 @@ const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
* Feature format for reading and writing data in the GML format, * Feature format for reading and writing data in the GML format,
* version 2.1.2. * version 2.1.2.
* *
* @constructor
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
* @extends {module:ol/format/GMLBase} * @extends {module:ol/format/GMLBase}
* @api * @api
*/ */
class GML2 { class GML2 {
/**
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
*/
constructor(opt_options) { constructor(opt_options) {
const options = /** @type {module:ol/format/GMLBase~Options} */ const options = /** @type {module:ol/format/GMLBase~Options} */
(opt_options ? opt_options : {}); (opt_options ? opt_options : {});

View File

@@ -48,13 +48,14 @@ const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
* version 3.1.1. * version 3.1.1.
* Currently only supports GML 3.1.1 Simple Features profile. * Currently only supports GML 3.1.1 Simple Features profile.
* *
* @constructor
* @param {module:ol/format/GMLBase~Options=} opt_options
* Optional configuration object.
* @extends {module:ol/format/GMLBase} * @extends {module:ol/format/GMLBase}
* @api * @api
*/ */
class GML3 { class GML3 {
/**
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
*/
constructor(opt_options) { constructor(opt_options) {
const options = /** @type {module:ol/format/GMLBase~Options} */ const options = /** @type {module:ol/format/GMLBase~Options} */
(opt_options ? opt_options : {}); (opt_options ? opt_options : {});

View File

@@ -83,13 +83,14 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
* This class cannot be instantiated, it contains only base content that * This class cannot be instantiated, it contains only base content that
* is shared with versioned format classes GML2 and GML3. * is shared with versioned format classes GML2 and GML3.
* *
* @constructor
* @abstract * @abstract
* @param {module:ol/format/GMLBase~Options=} opt_options
* Optional configuration object.
* @extends {module:ol/format/XMLFeature} * @extends {module:ol/format/XMLFeature}
*/ */
class GMLBase { class GMLBase {
/**
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
*/
constructor(opt_options) { constructor(opt_options) {
const options = /** @type {module:ol/format/GMLBase~Options} */ (opt_options ? opt_options : {}); const options = /** @type {module:ol/format/GMLBase~Options} */ (opt_options ? opt_options : {});

View File

@@ -103,12 +103,14 @@ const GPX_SERIALIZERS = makeStructureNS(
* @classdesc * @classdesc
* Feature format for reading and writing data in the GPX format. * Feature format for reading and writing data in the GPX format.
* *
* @constructor
* @extends {module:ol/format/XMLFeature} * @extends {module:ol/format/XMLFeature}
* @param {module:ol/format/GPX~Options=} opt_options Options.
* @api * @api
*/ */
class GPX { class GPX {
/**
* @param {module:ol/format/GPX~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -37,12 +37,14 @@ import {get as getProjection} from '../proj.js';
* @classdesc * @classdesc
* Feature format for reading and writing data in the GeoJSON format. * Feature format for reading and writing data in the GeoJSON format.
* *
* @constructor
* @extends {module:ol/format/JSONFeature} * @extends {module:ol/format/JSONFeature}
* @param {module:ol/format/GeoJSON~Options=} opt_options Options.
* @api * @api
*/ */
class GeoJSON { class GeoJSON {
/**
* @param {module:ol/format/GeoJSON~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -61,12 +61,14 @@ const NEWLINE_RE = /\r\n|\r|\n/;
* @classdesc * @classdesc
* Feature format for `*.igc` flight recording files. * Feature format for `*.igc` flight recording files.
* *
* @constructor
* @extends {module:ol/format/TextFeature} * @extends {module:ol/format/TextFeature}
* @param {module:ol/format/IGC~Options=} opt_options Options.
* @api * @api
*/ */
class IGC { class IGC {
/**
* @param {module:ol/format/IGC~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -11,7 +11,6 @@ import FormatType from '../format/FormatType.js';
* instantiated in apps. * instantiated in apps.
* Base class for JSON feature formats. * Base class for JSON feature formats.
* *
* @constructor
* @abstract * @abstract
* @extends {module:ol/format/Feature} * @extends {module:ol/format/Feature}
*/ */
@@ -21,121 +20,121 @@ class JSONFeature {
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
getType() { getType() {
return FormatType.JSON; return FormatType.JSON;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
readFeature(source, opt_options) { readFeature(source, opt_options) {
return this.readFeatureFromObject( return this.readFeatureFromObject(
getObject(source), this.getReadOptions(source, opt_options)); getObject(source), this.getReadOptions(source, opt_options));
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
readFeatures(source, opt_options) { readFeatures(source, opt_options) {
return this.readFeaturesFromObject( return this.readFeaturesFromObject(
getObject(source), this.getReadOptions(source, opt_options)); getObject(source), this.getReadOptions(source, opt_options));
} }
/** /**
* @abstract * @abstract
* @param {Object} object Object. * @param {Object} object Object.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @protected * @protected
* @return {module:ol/Feature} Feature. * @return {module:ol/Feature} Feature.
*/ */
readFeatureFromObject(object, opt_options) {} readFeatureFromObject(object, opt_options) {}
/** /**
* @abstract * @abstract
* @param {Object} object Object. * @param {Object} object Object.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @protected * @protected
* @return {Array.<module:ol/Feature>} Features. * @return {Array.<module:ol/Feature>} Features.
*/ */
readFeaturesFromObject(object, opt_options) {} readFeaturesFromObject(object, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
readGeometry(source, opt_options) { readGeometry(source, opt_options) {
return this.readGeometryFromObject( return this.readGeometryFromObject(
getObject(source), this.getReadOptions(source, opt_options)); getObject(source), this.getReadOptions(source, opt_options));
} }
/** /**
* @abstract * @abstract
* @param {Object} object Object. * @param {Object} object Object.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @protected * @protected
* @return {module:ol/geom/Geometry} Geometry. * @return {module:ol/geom/Geometry} Geometry.
*/ */
readGeometryFromObject(object, opt_options) {} readGeometryFromObject(object, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
readProjection(source) { readProjection(source) {
return this.readProjectionFromObject(getObject(source)); return this.readProjectionFromObject(getObject(source));
} }
/** /**
* @abstract * @abstract
* @param {Object} object Object. * @param {Object} object Object.
* @protected * @protected
* @return {module:ol/proj/Projection} Projection. * @return {module:ol/proj/Projection} Projection.
*/ */
readProjectionFromObject(object) {} readProjectionFromObject(object) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
writeFeature(feature, opt_options) { writeFeature(feature, opt_options) {
return JSON.stringify(this.writeFeatureObject(feature, opt_options)); return JSON.stringify(this.writeFeatureObject(feature, opt_options));
} }
/** /**
* @abstract * @abstract
* @param {module:ol/Feature} feature Feature. * @param {module:ol/Feature} feature Feature.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} Object. * @return {Object} Object.
*/ */
writeFeatureObject(feature, opt_options) {} writeFeatureObject(feature, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
writeFeatures(features, opt_options) { writeFeatures(features, opt_options) {
return JSON.stringify(this.writeFeaturesObject(features, opt_options)); return JSON.stringify(this.writeFeaturesObject(features, opt_options));
} }
/** /**
* @abstract * @abstract
* @param {Array.<module:ol/Feature>} features Features. * @param {Array.<module:ol/Feature>} features Features.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} Object. * @return {Object} Object.
*/ */
writeFeaturesObject(features, opt_options) {} writeFeaturesObject(features, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
writeGeometry(geometry, opt_options) { writeGeometry(geometry, opt_options) {
return JSON.stringify(this.writeGeometryObject(geometry, opt_options)); return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
} }
/** /**
* @abstract * @abstract
* @param {module:ol/geom/Geometry} geometry Geometry. * @param {module:ol/geom/Geometry} geometry Geometry.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @return {Object} Object. * @return {Object} Object.
*/ */
writeGeometryObject(geometry, opt_options) {} writeGeometryObject(geometry, opt_options) {}
} }

View File

@@ -391,12 +391,14 @@ function createStyleDefaults() {
* Note that the KML format uses the URL() constructor. Older browsers such as IE * Note that the KML format uses the URL() constructor. Older browsers such as IE
* which do not support this will need a URL polyfill to be loaded before use. * which do not support this will need a URL polyfill to be loaded before use.
* *
* @constructor
* @extends {module:ol/format/XMLFeature} * @extends {module:ol/format/XMLFeature}
* @param {module:ol/format/KML~Options=} opt_options Options.
* @api * @api
*/ */
class KML { class KML {
/**
* @param {module:ol/format/KML~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -42,12 +42,15 @@ import RenderFeature from '../render/Feature.js';
* @classdesc * @classdesc
* Feature format for reading data in the Mapbox MVT format. * Feature format for reading data in the Mapbox MVT format.
* *
* @constructor
* @extends {module:ol/format/Feature} * @extends {module:ol/format/Feature}
* @param {module:ol/format/MVT~Options=} opt_options Options. * @param {module:ol/format/MVT~Options=} opt_options Options.
* @api * @api
*/ */
class MVT { class MVT {
/**
* @param {module:ol/format/MVT~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
FeatureFormat.call(this); FeatureFormat.call(this);

View File

@@ -50,7 +50,6 @@ const PARSERS = makeStructureNS(
* Feature format for reading data in the * Feature format for reading data in the
* [OSMXML format](http://wiki.openstreetmap.org/wiki/OSM_XML). * [OSMXML format](http://wiki.openstreetmap.org/wiki/OSM_XML).
* *
* @constructor
* @extends {module:ol/format/XMLFeature} * @extends {module:ol/format/XMLFeature}
* @api * @api
*/ */

View File

@@ -28,7 +28,6 @@ const PARSERS = makeStructureNS(
/** /**
* @constructor
* @extends {module:ol/format/XML} * @extends {module:ol/format/XML}
*/ */
class OWS { class OWS {

View File

@@ -27,12 +27,14 @@ import {get as getProjection} from '../proj.js';
* Feature format for reading and writing data in the Encoded * Feature format for reading and writing data in the Encoded
* Polyline Algorithm Format. * Polyline Algorithm Format.
* *
* @constructor
* @extends {module:ol/format/TextFeature} * @extends {module:ol/format/TextFeature}
* @param {module:ol/format/Polyline~Options=} opt_options Optional configuration object.
* @api * @api
*/ */
class Polyline { class Polyline {
/**
* @param {module:ol/format/Polyline~Options=} opt_options Optional configuration object.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -11,7 +11,6 @@ import FormatType from '../format/FormatType.js';
* instantiated in apps. * instantiated in apps.
* Base class for text feature formats. * Base class for text feature formats.
* *
* @constructor
* @abstract * @abstract
* @extends {module:ol/format/Feature} * @extends {module:ol/format/Feature}
*/ */
@@ -21,122 +20,122 @@ class TextFeature {
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
getType() { getType() {
return FormatType.TEXT; return FormatType.TEXT;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
readFeature(source, opt_options) { readFeature(source, opt_options) {
return this.readFeatureFromText(getText(source), this.adaptOptions(opt_options)); return this.readFeatureFromText(getText(source), this.adaptOptions(opt_options));
} }
/** /**
* @abstract * @abstract
* @param {string} text Text. * @param {string} text Text.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @protected * @protected
* @return {module:ol/Feature} Feature. * @return {module:ol/Feature} Feature.
*/ */
readFeatureFromText(text, opt_options) {} readFeatureFromText(text, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
readFeatures(source, opt_options) { readFeatures(source, opt_options) {
return this.readFeaturesFromText(getText(source), this.adaptOptions(opt_options)); return this.readFeaturesFromText(getText(source), this.adaptOptions(opt_options));
} }
/** /**
* @abstract * @abstract
* @param {string} text Text. * @param {string} text Text.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @protected * @protected
* @return {Array.<module:ol/Feature>} Features. * @return {Array.<module:ol/Feature>} Features.
*/ */
readFeaturesFromText(text, opt_options) {} readFeaturesFromText(text, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
readGeometry(source, opt_options) { readGeometry(source, opt_options) {
return this.readGeometryFromText(getText(source), this.adaptOptions(opt_options)); return this.readGeometryFromText(getText(source), this.adaptOptions(opt_options));
} }
/** /**
* @abstract * @abstract
* @param {string} text Text. * @param {string} text Text.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @protected * @protected
* @return {module:ol/geom/Geometry} Geometry. * @return {module:ol/geom/Geometry} Geometry.
*/ */
readGeometryFromText(text, opt_options) {} readGeometryFromText(text, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
readProjection(source) { readProjection(source) {
return this.readProjectionFromText(getText(source)); return this.readProjectionFromText(getText(source));
} }
/** /**
* @param {string} text Text. * @param {string} text Text.
* @protected * @protected
* @return {module:ol/proj/Projection} Projection. * @return {module:ol/proj/Projection} Projection.
*/ */
readProjectionFromText(text) { readProjectionFromText(text) {
return this.dataProjection; return this.dataProjection;
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
writeFeature(feature, opt_options) { writeFeature(feature, opt_options) {
return this.writeFeatureText(feature, this.adaptOptions(opt_options)); return this.writeFeatureText(feature, this.adaptOptions(opt_options));
} }
/** /**
* @abstract * @abstract
* @param {module:ol/Feature} feature Features. * @param {module:ol/Feature} feature Features.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @protected * @protected
* @return {string} Text. * @return {string} Text.
*/ */
writeFeatureText(feature, opt_options) {} writeFeatureText(feature, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
writeFeatures(features, opt_options) { writeFeatures(features, opt_options) {
return this.writeFeaturesText(features, this.adaptOptions(opt_options)); return this.writeFeaturesText(features, this.adaptOptions(opt_options));
} }
/** /**
* @abstract * @abstract
* @param {Array.<module:ol/Feature>} features Features. * @param {Array.<module:ol/Feature>} features Features.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @protected * @protected
* @return {string} Text. * @return {string} Text.
*/ */
writeFeaturesText(features, opt_options) {} writeFeaturesText(features, opt_options) {}
/** /**
* @inheritDoc * @inheritDoc
*/ */
writeGeometry(geometry, opt_options) { writeGeometry(geometry, opt_options) {
return this.writeGeometryText(geometry, this.adaptOptions(opt_options)); return this.writeGeometryText(geometry, this.adaptOptions(opt_options));
} }
/** /**
* @abstract * @abstract
* @param {module:ol/geom/Geometry} geometry Geometry. * @param {module:ol/geom/Geometry} geometry Geometry.
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
* @protected * @protected
* @return {string} Text. * @return {string} Text.
*/ */
writeGeometryText(geometry, opt_options) {} writeGeometryText(geometry, opt_options) {}
} }

View File

@@ -43,12 +43,14 @@ import {get as getProjection} from '../proj.js';
* @classdesc * @classdesc
* Feature format for reading data in the TopoJSON format. * Feature format for reading data in the TopoJSON format.
* *
* @constructor
* @extends {module:ol/format/JSONFeature} * @extends {module:ol/format/JSONFeature}
* @param {module:ol/format/TopoJSON~Options=} opt_options Options.
* @api * @api
*/ */
class TopoJSON { class TopoJSON {
/**
* @param {module:ol/format/TopoJSON~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -201,12 +201,14 @@ const DEFAULT_VERSION = '1.1.0';
* as option if you want to read a WFS that contains GML2 (WFS 1.0.0). * as option if you want to read a WFS that contains GML2 (WFS 1.0.0).
* Also see {@link module:ol/format/GMLBase~GMLBase} which is used by this format. * Also see {@link module:ol/format/GMLBase~GMLBase} which is used by this format.
* *
* @constructor
* @param {module:ol/format/WFS~Options=} opt_options Optional configuration object.
* @extends {module:ol/format/XMLFeature} * @extends {module:ol/format/XMLFeature}
* @api * @api
*/ */
class WFS { class WFS {
/**
* @param {module:ol/format/WFS~Options=} opt_options Optional configuration object.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -87,10 +87,12 @@ const TokenType = {
/** /**
* Class to tokenize a WKT string. * Class to tokenize a WKT string.
* @param {string} wkt WKT string.
* @constructor
*/ */
class Lexer { class Lexer {
/**
* @param {string} wkt WKT string.
*/
constructor(wkt) { constructor(wkt) {
/** /**
@@ -218,10 +220,12 @@ class Lexer {
/** /**
* Class to parse the tokens from the WKT string. * Class to parse the tokens from the WKT string.
* @param {module:ol/format/WKT~Lexer} lexer The lexer.
* @constructor
*/ */
class Parser { class Parser {
/**
* @param {module:ol/format/WKT~Lexer} lexer The lexer.
*/
constructor(lexer) { constructor(lexer) {
/** /**
@@ -590,12 +594,14 @@ class Parser {
* Geometry format for reading and writing data in the `WellKnownText` (WKT) * Geometry format for reading and writing data in the `WellKnownText` (WKT)
* format. * format.
* *
* @constructor
* @extends {module:ol/format/TextFeature} * @extends {module:ol/format/TextFeature}
* @param {module:ol/format/WKT~Options=} opt_options Options.
* @api * @api
*/ */
class WKT { class WKT {
/**
* @param {module:ol/format/WKT~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -46,7 +46,6 @@ const CAPABILITY_PARSERS = makeStructureNS(
* @classdesc * @classdesc
* Format for reading WMS capabilities data * Format for reading WMS capabilities data
* *
* @constructor
* @extends {module:ol/format/XML} * @extends {module:ol/format/XML}
* @api * @api
*/ */

View File

@@ -34,12 +34,14 @@ const layerIdentifier = '_layer';
* Format for reading WMSGetFeatureInfo format. It uses * Format for reading WMSGetFeatureInfo format. It uses
* {@link module:ol/format/GML2~GML2} to read features. * {@link module:ol/format/GML2~GML2} to read features.
* *
* @constructor
* @extends {module:ol/format/XMLFeature} * @extends {module:ol/format/XMLFeature}
* @param {module:ol/format/WMSGetFeatureInfo~Options=} opt_options Options.
* @api * @api
*/ */
class WMSGetFeatureInfo { class WMSGetFeatureInfo {
/**
* @param {module:ol/format/WMSGetFeatureInfo~Options=} opt_options Options.
*/
constructor(opt_options) { constructor(opt_options) {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};

View File

@@ -45,7 +45,6 @@ const PARSERS = makeStructureNS(
* @classdesc * @classdesc
* Format for reading WMTS capabilities data. * Format for reading WMTS capabilities data.
* *
* @constructor
* @extends {module:ol/format/XML} * @extends {module:ol/format/XML}
* @api * @api
*/ */

View File

@@ -7,15 +7,13 @@ import {isDocument, isNode, parse} from '../xml.js';
* @classdesc * @classdesc
* Generic format for reading non-feature XML data * Generic format for reading non-feature XML data
* *
* @constructor
* @abstract * @abstract
* @struct
*/ */
class XML { class XML {
/** /**
* @param {Document|Node|string} source Source. * @param {Document|Node|string} source Source.
* @return {Object} The parsed result. * @return {Object} The parsed result.
*/ */
read(source) { read(source) {
if (isDocument(source)) { if (isDocument(source)) {
return this.readFromDocument(/** @type {Document} */ (source)); return this.readFromDocument(/** @type {Document} */ (source));
@@ -30,17 +28,17 @@ class XML {
} }
/** /**
* @abstract * @abstract
* @param {Document} doc Document. * @param {Document} doc Document.
* @return {Object} Object * @return {Object} Object
*/ */
readFromDocument(doc) {} readFromDocument(doc) {}
/** /**
* @abstract * @abstract
* @param {Node} node Node. * @param {Node} node Node.
* @return {Object} Object * @return {Object} Object
*/ */
readFromNode(node) {} readFromNode(node) {}
} }

View File

@@ -13,7 +13,6 @@ import {isDocument, isNode, parse} from '../xml.js';
* instantiated in apps. * instantiated in apps.
* Base class for XML feature formats. * Base class for XML feature formats.
* *
* @constructor
* @abstract * @abstract
* @extends {module:ol/format/Feature} * @extends {module:ol/format/Feature}
*/ */