Use extends and super for geom

This commit is contained in:
Frederic Junod
2018-07-17 16:18:30 +02:00
parent 44bea898b8
commit c707b4c746
11 changed files with 204 additions and 238 deletions
+8 -11
View File
@@ -1,7 +1,6 @@
/**
* @module ol/geom/LinearRing
*/
import {inherits} from '../util.js';
import {closestSquaredDistanceXY} from '../extent.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import GeometryType from '../geom/GeometryType.js';
@@ -17,18 +16,18 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
* Linear ring geometry. Only used as part of polygon; cannot be rendered
* on its own.
*
* @constructor
* @extends {module:ol/geom/SimpleGeometry}
* @param {Array.<module:ol/coordinate~Coordinate>|Array.<number>} coordinates
* Coordinates. (For internal use, flat coordinates in combination with
* `opt_layout` are also accepted.)
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
* @api
*/
class LinearRing {
class LinearRing extends SimpleGeometry {
/**
* @param {Array.<module:ol/coordinate~Coordinate>|Array.<number>} coordinates Coordinates.
* For internal use, flat coordinates in combination with `opt_layout` are also accepted.
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
*/
constructor(coordinates, opt_layout) {
SimpleGeometry.call(this);
super();
/**
* @private
@@ -139,7 +138,5 @@ class LinearRing {
}
}
inherits(LinearRing, SimpleGeometry);
export default LinearRing;