Use extends, super and proper constructor jsdoc for ol/interaction
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @module ol/interaction/DoubleClickZoom
|
||||
*/
|
||||
import {inherits} from '../util.js';
|
||||
import MapBrowserEventType from '../MapBrowserEventType.js';
|
||||
import Interaction, {zoomByDelta} from '../interaction/Interaction.js';
|
||||
|
||||
@@ -16,15 +15,17 @@ import Interaction, {zoomByDelta} from '../interaction/Interaction.js';
|
||||
/**
|
||||
* @classdesc
|
||||
* Allows the user to zoom by double-clicking on the map.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/interaction/Interaction}
|
||||
* @param {module:ol/interaction/DoubleClickZoom~Options=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
class DoubleClickZoom {
|
||||
class DoubleClickZoom extends Interaction {
|
||||
|
||||
/**
|
||||
* @param {module:ol/interaction/DoubleClickZoom~Options=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super({
|
||||
handleEvent: handleEvent
|
||||
});
|
||||
|
||||
const options = opt_options ? opt_options : {};
|
||||
|
||||
@@ -34,10 +35,6 @@ class DoubleClickZoom {
|
||||
*/
|
||||
this.delta_ = options.delta ? options.delta : 1;
|
||||
|
||||
Interaction.call(this, {
|
||||
handleEvent: handleEvent
|
||||
});
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
@@ -48,8 +45,6 @@ class DoubleClickZoom {
|
||||
|
||||
}
|
||||
|
||||
inherits(DoubleClickZoom, Interaction);
|
||||
|
||||
|
||||
/**
|
||||
* Handles the {@link module:ol/MapBrowserEvent map browser event} (if it was a
|
||||
|
||||
Reference in New Issue
Block a user