Use extends and super for control/Control
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/control/Control
|
* @module ol/control/Control
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../util.js';
|
|
||||||
import {UNDEFINED} from '../functions.js';
|
import {UNDEFINED} from '../functions.js';
|
||||||
import MapEventType from '../MapEventType.js';
|
import MapEventType from '../MapEventType.js';
|
||||||
import BaseObject from '../Object.js';
|
import BaseObject from '../Object.js';
|
||||||
@@ -45,14 +44,13 @@ import {listen, unlistenByKey} from '../events.js';
|
|||||||
* examples/custom-controls for an example of how to do this.
|
* examples/custom-controls for an example of how to do this.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {module:ol/Object}
|
|
||||||
* @param {module:ol/control/Control~Options} options Control options.
|
* @param {module:ol/control/Control~Options} options Control options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class Control {
|
class Control extends BaseObject {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
|
||||||
BaseObject.call(this);
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
@@ -94,7 +92,7 @@ class Control {
|
|||||||
*/
|
*/
|
||||||
disposeInternal() {
|
disposeInternal() {
|
||||||
removeNode(this.element);
|
removeNode(this.element);
|
||||||
BaseObject.prototype.disposeInternal.call(this);
|
super.disposeInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,7 +148,5 @@ class Control {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inherits(Control, BaseObject);
|
|
||||||
|
|
||||||
|
|
||||||
export default Control;
|
export default Control;
|
||||||
|
|||||||
Reference in New Issue
Block a user