diff --git a/src/ol/format/TextFeature.js b/src/ol/format/TextFeature.js index a1bb7c965c..0f866bdfd6 100644 --- a/src/ol/format/TextFeature.js +++ b/src/ol/format/TextFeature.js @@ -109,7 +109,13 @@ class TextFeature extends FeatureFormat { } /** - * @inheritDoc + * Encode a feature as a string. + * + * @function + * @param {module:ol/Feature} feature Feature. + * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. + * @return {string} Encoded feature. + * @api */ writeFeature(feature, opt_options) { return this.writeFeatureText(feature, this.adaptOptions(opt_options)); @@ -125,7 +131,12 @@ class TextFeature extends FeatureFormat { writeFeatureText(feature, opt_options) {} /** - * @inheritDoc + * Encode an array of features as string. + * + * @param {Array.} features Features. + * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. + * @return {string} Encoded features. + * @api */ writeFeatures(features, opt_options) { return this.writeFeaturesText(features, this.adaptOptions(opt_options)); @@ -141,7 +152,7 @@ class TextFeature extends FeatureFormat { writeFeaturesText(features, opt_options) {} /** - * Write a single geometry in Polyline format. + * Write a single geometry. * * @function * @param {module:ol/geom/Geometry} geometry Geometry. diff --git a/src/ol/format/WKT.js b/src/ol/format/WKT.js index 4a73ae6da7..463ec6ee2d 100644 --- a/src/ol/format/WKT.js +++ b/src/ol/format/WKT.js @@ -1,7 +1,6 @@ /** * @module ol/format/WKT */ -import {inherits} from '../util.js'; import Feature from '../Feature.js'; import {transformWithOptions} from '../format/Feature.js'; import TextFeature from '../format/TextFeature.js'; @@ -594,19 +593,18 @@ class Parser { * Geometry format for reading and writing data in the `WellKnownText` (WKT) * format. * - * @extends {module:ol/format/TextFeature} * @api */ -class WKT { +class WKT extends TextFeature { /** * @param {module:ol/format/WKT~Options=} opt_options Options. */ constructor(opt_options) { + super(); const options = opt_options ? opt_options : {}; - TextFeature.call(this); /** * Split GeometryCollection into multiple features. @@ -715,8 +713,6 @@ class WKT { } } -inherits(WKT, TextFeature); - /** * @param {module:ol/geom/Point} geom Point geometry. @@ -869,76 +865,4 @@ function encode(geom) { } -/** - * Read a feature from a WKT source. - * - * @function - * @param {Document|Node|Object|string} source Source. - * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. - * @return {module:ol/Feature} Feature. - * @api - */ -WKT.prototype.readFeature; - - -/** - * Read all features from a WKT source. - * - * @function - * @param {Document|Node|Object|string} source Source. - * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. - * @return {Array.} Features. - * @api - */ -WKT.prototype.readFeatures; - - -/** - * Read a single geometry from a WKT source. - * - * @function - * @param {Document|Node|Object|string} source Source. - * @param {module:ol/format/Feature~ReadOptions=} opt_options Read options. - * @return {module:ol/geom/Geometry} Geometry. - * @api - */ -WKT.prototype.readGeometry; - - -/** - * Encode a feature as a WKT string. - * - * @function - * @param {module:ol/Feature} feature Feature. - * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. - * @return {string} WKT string. - * @api - */ -WKT.prototype.writeFeature; - - -/** - * Encode an array of features as a WKT string. - * - * @function - * @param {Array.} features Features. - * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. - * @return {string} WKT string. - * @api - */ -WKT.prototype.writeFeatures; - - -/** - * Write a single geometry as a WKT string. - * - * @function - * @param {module:ol/geom/Geometry} geometry Geometry. - * @param {module:ol/format/Feature~WriteOptions=} opt_options Write options. - * @return {string} WKT string. - * @api - */ -WKT.prototype.writeGeometry; - - export default WKT;