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/DragRotate
*/
import {inherits} from '../util.js';
import {disable} from '../rotationconstraint.js';
import ViewHint from '../ViewHint.js';
import {altShiftKeysOnly, mouseOnly, mouseActionButton} from '../events/condition.js';
@@ -27,22 +26,22 @@ import PointerInteraction from '../interaction/Pointer.js';
* it to when the alt and shift keys are held down.
*
* This interaction is only supported for mouse devices.
*
* @constructor
* @extends {module:ol/interaction/Pointer}
* @param {module:ol/interaction/DragRotate~Options=} opt_options Options.
* @api
*/
class DragRotate {
class DragRotate extends PointerInteraction {
/**
* @param {module:ol/interaction/DragRotate~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {
const options = opt_options ? opt_options : {};
PointerInteraction.call(this, {
super({
handleDownEvent: handleDownEvent,
handleDragEvent: handleDragEvent,
handleUpEvent: handleUpEvent
handleUpEvent: handleUpEvent,
stopDown: FALSE
});
/**
@@ -67,8 +66,6 @@ class DragRotate {
}
inherits(DragRotate, PointerInteraction);
/**
* @param {module:ol/MapBrowserPointerEvent} mapBrowserEvent Event.
@@ -136,9 +133,4 @@ function handleDownEvent(mapBrowserEvent) {
}
}
/**
* @inheritDoc
*/
DragRotate.prototype.shouldStopEvent = FALSE;
export default DragRotate;