Use extends, super and proper constructor jsdoc for ol/interaction

This commit is contained in:
ahocevar
2018-07-17 21:09:06 +02:00
parent fd962caa1c
commit e79add2e77
20 changed files with 273 additions and 402 deletions

View File

@@ -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