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/DragPan
*/
import {inherits} from '../util.js';
import ViewHint from '../ViewHint.js';
import {scale as scaleCoordinate, rotate as rotateCoordinate, add as addCoordinate} from '../coordinate.js';
import {easeOut} from '../easing.js';
@@ -22,19 +21,19 @@ import PointerInteraction, {centroid as centroidFromPointers} from '../interacti
/**
* @classdesc
* Allows the user to pan the map by dragging the map.
*
* @constructor
* @extends {module:ol/interaction/Pointer}
* @param {module:ol/interaction/DragPan~Options=} opt_options Options.
* @api
*/
class DragPan {
class DragPan extends PointerInteraction {
/**
* @param {module:ol/interaction/DragPan~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {
PointerInteraction.call(this, {
super({
handleDownEvent: handleDownEvent,
handleDragEvent: handleDragEvent,
handleUpEvent: handleUpEvent
handleUpEvent: handleUpEvent,
stopDown: FALSE
});
const options = opt_options ? opt_options : {};
@@ -71,8 +70,6 @@ class DragPan {
}
inherits(DragPan, PointerInteraction);
/**
* @param {module:ol/MapBrowserPointerEvent} mapBrowserEvent Event.
@@ -175,8 +172,4 @@ function handleDownEvent(mapBrowserEvent) {
}
/**
* @inheritDoc
*/
DragPan.prototype.shouldStopEvent = FALSE;
export default DragPan;