Use extends and super for format/OSMXML

This commit is contained in:
ahocevar
2018-07-17 17:02:55 +02:00
parent cf15af43e3
commit 5e71e6ce80

View File

@@ -2,7 +2,6 @@
* @module ol/format/OSMXML * @module ol/format/OSMXML
*/ */
// FIXME add typedef for stack state objects // FIXME add typedef for stack state objects
import {inherits} from '../util.js';
import {extend} from '../array.js'; import {extend} from '../array.js';
import Feature from '../Feature.js'; import Feature from '../Feature.js';
import {transformWithOptions} from '../format/Feature.js'; import {transformWithOptions} from '../format/Feature.js';
@@ -50,12 +49,11 @@ 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).
* *
* @extends {module:ol/format/XMLFeature}
* @api * @api
*/ */
class OSMXML { class OSMXML extends XMLFeature {
constructor() { constructor() {
XMLFeature.call(this); super();
/** /**
* @inheritDoc * @inheritDoc
@@ -122,8 +120,6 @@ class OSMXML {
writeGeometryNode(geometry, opt_options) {} writeGeometryNode(geometry, opt_options) {}
} }
inherits(OSMXML, XMLFeature);
/** /**
* @const * @const
@@ -200,27 +196,4 @@ function readTag(node, objectStack) {
} }
/**
* Read all features from an OSM source.
*
* @function
* @param {Document|Node|Object|string} source Source.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
* @return {Array.<module:ol/Feature>} Features.
* @api
*/
OSMXML.prototype.readFeatures;
/**
* Read the projection from an OSM source.
*
* @function
* @param {Document|Node|Object|string} source Source.
* @return {module:ol/proj/Projection} Projection.
* @api
*/
OSMXML.prototype.readProjection;
export default OSMXML; export default OSMXML;