Use extends and super for format/TopoJSON
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @module ol/format/TopoJSON
|
||||
*/
|
||||
import {inherits} from '../util.js';
|
||||
import Feature from '../Feature.js';
|
||||
import {transformWithOptions} from '../format/Feature.js';
|
||||
import JSONFeature from '../format/JSONFeature.js';
|
||||
@@ -43,20 +42,18 @@ import {get as getProjection} from '../proj.js';
|
||||
* @classdesc
|
||||
* Feature format for reading data in the TopoJSON format.
|
||||
*
|
||||
* @extends {module:ol/format/JSONFeature}
|
||||
* @api
|
||||
*/
|
||||
class TopoJSON {
|
||||
class TopoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @param {module:ol/format/TopoJSON~Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
|
||||
const options = opt_options ? opt_options : {};
|
||||
|
||||
JSONFeature.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string|undefined}
|
||||
@@ -157,8 +154,6 @@ class TopoJSON {
|
||||
readFeatureFromObject() {}
|
||||
}
|
||||
|
||||
inherits(TopoJSON, JSONFeature);
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
@@ -380,17 +375,6 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read all features from a TopoJSON source.
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
TopoJSON.prototype.readFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* Apply a linear transform to array of arcs. The provided array of arcs is
|
||||
* modified in place.
|
||||
@@ -441,15 +425,4 @@ function transformVertex(vertex, scale, translate) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read the projection from a TopoJSON source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} object Source.
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
TopoJSON.prototype.readProjection;
|
||||
|
||||
|
||||
export default TopoJSON;
|
||||
|
||||
Reference in New Issue
Block a user