Don't import ourselves
This commit is contained in:
@@ -51,7 +51,7 @@ class DoubleClickZoom extends Interaction {
|
||||
* doubleclick) and eventually zooms the map.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {import("./DoubleClickZoom.js").default}
|
||||
* @this {DoubleClickZoom}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
let stopEvent = false;
|
||||
|
||||
@@ -244,7 +244,7 @@ class DragAndDrop extends Interaction {
|
||||
|
||||
/**
|
||||
* @param {DragEvent} event Event.
|
||||
* @this {import("./DragAndDrop.js").default}
|
||||
* @this {DragAndDrop}
|
||||
*/
|
||||
function handleDrop(event) {
|
||||
const files = event.dataTransfer.files;
|
||||
|
||||
@@ -28,7 +28,7 @@ import RenderBox from '../render/Box.js';
|
||||
* @property {EndCondition} [boxEndCondition] A function that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and two
|
||||
* {@link module:ol/pixel~Pixel}s to indicate whether a `boxend` event should be fired.
|
||||
* Default is `true` if the area of the box is bigger than the `minArea` option.
|
||||
* @property {function(this:import("./DragBox.js").default, import("../MapBrowserEvent.js").default)} onBoxEnd Code to execute just
|
||||
* @property {function(this:DragBox, import("../MapBrowserEvent.js").default)} onBoxEnd Code to execute just
|
||||
* before `boxend` is fired.
|
||||
*/
|
||||
|
||||
@@ -137,7 +137,7 @@ class DragBox extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Function to execute just before `onboxend` is fired
|
||||
* @type {function(this:import("./DragBox.js").default, import("../MapBrowserEvent.js").default)}
|
||||
* @type {function(this:DragBox, import("../MapBrowserEvent.js").default)}
|
||||
* @private
|
||||
*/
|
||||
this.onBoxEnd_ = options.onBoxEnd ? options.onBoxEnd : VOID;
|
||||
@@ -181,7 +181,7 @@ class DragBox extends PointerInteraction {
|
||||
* @param {import("../pixel.js").Pixel} startPixel The starting pixel of the box.
|
||||
* @param {import("../pixel.js").Pixel} endPixel The end pixel of the box.
|
||||
* @return {boolean} Whether or not the boxend condition should be fired.
|
||||
* @this {import("./DragBox.js").default}
|
||||
* @this {DragBox}
|
||||
*/
|
||||
function defaultBoxEndCondition(mapBrowserEvent, startPixel, endPixel) {
|
||||
const width = endPixel[0] - startPixel[0];
|
||||
@@ -192,7 +192,7 @@ function defaultBoxEndCondition(mapBrowserEvent, startPixel, endPixel) {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./DragBox.js").default}
|
||||
* @this {DragBox}
|
||||
*/
|
||||
function handleDragEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
@@ -209,7 +209,7 @@ function handleDragEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./DragBox.js").default}
|
||||
* @this {DragBox}
|
||||
*/
|
||||
function handleUpEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
@@ -230,7 +230,7 @@ function handleUpEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./DragBox.js").default}
|
||||
* @this {DragBox}
|
||||
*/
|
||||
function handleDownEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
|
||||
@@ -78,7 +78,7 @@ class DragPan extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./DragPan.js").default}
|
||||
* @this {DragPan}
|
||||
*/
|
||||
function handleDragEvent(mapBrowserEvent) {
|
||||
if (!this.panning_) {
|
||||
@@ -116,7 +116,7 @@ function handleDragEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./DragPan.js").default}
|
||||
* @this {DragPan}
|
||||
*/
|
||||
function handleUpEvent(mapBrowserEvent) {
|
||||
const map = mapBrowserEvent.map;
|
||||
@@ -157,7 +157,7 @@ function handleUpEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./DragPan.js").default}
|
||||
* @this {DragPan}
|
||||
*/
|
||||
function handleDownEvent(mapBrowserEvent) {
|
||||
if (this.targetPointers.length > 0 && this.condition_(mapBrowserEvent)) {
|
||||
|
||||
@@ -69,7 +69,7 @@ class DragRotate extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./DragRotate.js").default}
|
||||
* @this {DragRotate}
|
||||
*/
|
||||
function handleDragEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
@@ -97,7 +97,7 @@ function handleDragEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./DragRotate.js").default}
|
||||
* @this {DragRotate}
|
||||
*/
|
||||
function handleUpEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
@@ -116,7 +116,7 @@ function handleUpEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./DragRotate.js").default}
|
||||
* @this {DragRotate}
|
||||
*/
|
||||
function handleDownEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
|
||||
@@ -81,7 +81,7 @@ class DragRotateAndZoom extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./DragRotateAndZoom.js").default}
|
||||
* @this {DragRotateAndZoom}
|
||||
*/
|
||||
function handleDragEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
@@ -115,7 +115,7 @@ function handleDragEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./DragRotateAndZoom.js").default}
|
||||
* @this {DragRotateAndZoom}
|
||||
*/
|
||||
function handleUpEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
@@ -136,7 +136,7 @@ function handleUpEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./DragRotateAndZoom.js").default}
|
||||
* @this {DragRotateAndZoom}
|
||||
*/
|
||||
function handleDownEvent(mapBrowserEvent) {
|
||||
if (!mouseOnly(mapBrowserEvent)) {
|
||||
|
||||
@@ -61,7 +61,7 @@ class DragZoom extends DragBox {
|
||||
|
||||
|
||||
/**
|
||||
* @this {import("./DragZoom.js").default}
|
||||
* @this {DragZoom}
|
||||
*/
|
||||
function onBoxEnd() {
|
||||
const map = this.getMap();
|
||||
|
||||
@@ -823,7 +823,7 @@ function getDefaultStyleFunction() {
|
||||
* draw or finish the drawing.
|
||||
* @param {import("../MapBrowserEvent.js").default} event Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {import("./Draw.js").default}
|
||||
* @this {Draw}
|
||||
* @api
|
||||
*/
|
||||
export function handleEvent(event) {
|
||||
@@ -875,7 +875,7 @@ export function handleEvent(event) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} event Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./Draw.js").default}
|
||||
* @this {Draw}
|
||||
*/
|
||||
function handleDownEvent(event) {
|
||||
this.shouldHandle_ = !this.freehand_;
|
||||
@@ -903,7 +903,7 @@ function handleDownEvent(event) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} event Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./Draw.js").default}
|
||||
* @this {Draw}
|
||||
*/
|
||||
function handleUpEvent(event) {
|
||||
let pass = true;
|
||||
|
||||
@@ -87,7 +87,7 @@ class KeyboardPan extends Interaction {
|
||||
* pressed).
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {import("./KeyboardPan.js").default}
|
||||
* @this {KeyboardPan}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
let stopEvent = false;
|
||||
|
||||
@@ -71,7 +71,7 @@ class KeyboardZoom extends Interaction {
|
||||
* key pressed was '+' or '-').
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {import("./KeyboardZoom.js").default}
|
||||
* @this {KeyboardZoom}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
let stopEvent = false;
|
||||
|
||||
@@ -987,7 +987,7 @@ function compareIndexes(a, b) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./Modify.js").default}
|
||||
* @this {Modify}
|
||||
*/
|
||||
function handleDownEvent(evt) {
|
||||
if (!this.condition_(evt)) {
|
||||
@@ -1062,7 +1062,7 @@ function handleDownEvent(evt) {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Event.
|
||||
* @this {import("./Modify.js").default}
|
||||
* @this {Modify}
|
||||
*/
|
||||
function handleDragEvent(evt) {
|
||||
this.ignoreNextSingleClick_ = false;
|
||||
@@ -1139,7 +1139,7 @@ function handleDragEvent(evt) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./Modify.js").default}
|
||||
* @this {Modify}
|
||||
*/
|
||||
function handleUpEvent(evt) {
|
||||
for (let i = this.dragSegments_.length - 1; i >= 0; --i) {
|
||||
@@ -1171,7 +1171,7 @@ function handleUpEvent(evt) {
|
||||
* geometry.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {import("./Modify.js").default}
|
||||
* @this {Modify}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
|
||||
@@ -196,7 +196,7 @@ class MouseWheelZoom extends Interaction {
|
||||
* mousewheel-event) and eventually zooms the map.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} Allow event propagation.
|
||||
* @this {import("./MouseWheelZoom.js").default}
|
||||
* @this {MouseWheelZoom}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
if (!this.condition_(mapBrowserEvent)) {
|
||||
|
||||
@@ -80,7 +80,7 @@ class PinchRotate extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./PinchRotate.js").default}
|
||||
* @this {PinchRotate}
|
||||
*/
|
||||
function handleDragEvent(mapBrowserEvent) {
|
||||
let rotationDelta = 0.0;
|
||||
@@ -131,7 +131,7 @@ function handleDragEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./PinchRotate.js").default}
|
||||
* @this {PinchRotate}
|
||||
*/
|
||||
function handleUpEvent(mapBrowserEvent) {
|
||||
if (this.targetPointers.length < 2) {
|
||||
@@ -152,7 +152,7 @@ function handleUpEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./PinchRotate.js").default}
|
||||
* @this {PinchRotate}
|
||||
*/
|
||||
function handleDownEvent(mapBrowserEvent) {
|
||||
if (this.targetPointers.length >= 2) {
|
||||
|
||||
@@ -73,7 +73,7 @@ class PinchZoom extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./PinchZoom.js").default}
|
||||
* @this {PinchZoom}
|
||||
*/
|
||||
function handleDragEvent(mapBrowserEvent) {
|
||||
let scaleDelta = 1.0;
|
||||
@@ -126,7 +126,7 @@ function handleDragEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./PinchZoom.js").default}
|
||||
* @this {PinchZoom}
|
||||
*/
|
||||
function handleUpEvent(mapBrowserEvent) {
|
||||
if (this.targetPointers.length < 2) {
|
||||
@@ -153,7 +153,7 @@ function handleUpEvent(mapBrowserEvent) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./PinchZoom.js").default}
|
||||
* @this {PinchZoom}
|
||||
*/
|
||||
function handleDownEvent(mapBrowserEvent) {
|
||||
if (this.targetPointers.length >= 2) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {getValues} from '../obj.js';
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./Pointer.js").default}
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
const handleDragEvent = VOID;
|
||||
|
||||
@@ -18,7 +18,7 @@ const handleDragEvent = VOID;
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Capture dragging.
|
||||
* @this {import("./Pointer.js").default}
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
const handleUpEvent = FALSE;
|
||||
|
||||
@@ -26,14 +26,14 @@ const handleUpEvent = FALSE;
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @return {boolean} Capture dragging.
|
||||
* @this {import("./Pointer.js").default}
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
const handleDownEvent = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} mapBrowserEvent Event.
|
||||
* @this {import("./Pointer.js").default}
|
||||
* @this {PointerInteraction}
|
||||
*/
|
||||
const handleMoveEvent = VOID;
|
||||
|
||||
@@ -203,7 +203,7 @@ function isPointerDraggingEvent(mapBrowserEvent) {
|
||||
* detected.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {import("./Pointer.js").default}
|
||||
* @this {PointerInteraction}
|
||||
* @api
|
||||
*/
|
||||
export function handleEvent(mapBrowserEvent) {
|
||||
|
||||
@@ -385,7 +385,7 @@ class Select extends Interaction {
|
||||
* selected state of features.
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} `false` to stop event propagation.
|
||||
* @this {import("./Select.js").default}
|
||||
* @this {Select}
|
||||
*/
|
||||
function handleEvent(mapBrowserEvent) {
|
||||
if (!this.condition_(mapBrowserEvent)) {
|
||||
|
||||
@@ -591,7 +591,7 @@ class Snap extends PointerInteraction {
|
||||
* Handle all pointer events events.
|
||||
* @param {import("../MapBrowserEvent.js").default} evt A move event.
|
||||
* @return {boolean} Pass the event to other interactions.
|
||||
* @this {import("./Snap.js").default}
|
||||
* @this {Snap}
|
||||
*/
|
||||
export function handleEvent(evt) {
|
||||
const result = this.snapTo(evt.pixel, evt.coordinate, evt.map);
|
||||
@@ -606,7 +606,7 @@ export function handleEvent(evt) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} evt Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./Snap.js").default}
|
||||
* @this {Snap}
|
||||
*/
|
||||
function handleUpEvent(evt) {
|
||||
const featuresToUpdate = getValues(this.pendingFeatures_);
|
||||
@@ -623,7 +623,7 @@ function handleUpEvent(evt) {
|
||||
* @param {SegmentData} a The first segment data.
|
||||
* @param {SegmentData} b The second segment data.
|
||||
* @return {number} The difference in distance.
|
||||
* @this {import("./Snap.js").default}
|
||||
* @this {Snap}
|
||||
*/
|
||||
function sortByDistance(a, b) {
|
||||
const deltaA = squaredDistanceToSegment(this.pixelCoordinate_, a.segment);
|
||||
|
||||
@@ -238,7 +238,7 @@ class Translate extends PointerInteraction {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} event Event.
|
||||
* @return {boolean} Start drag sequence?
|
||||
* @this {import("./Translate.js").default}
|
||||
* @this {Translate}
|
||||
*/
|
||||
function handleDownEvent(event) {
|
||||
this.lastFeature_ = this.featuresAtPixel_(event.pixel, event.map);
|
||||
@@ -261,7 +261,7 @@ function handleDownEvent(event) {
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} event Event.
|
||||
* @return {boolean} Stop drag sequence?
|
||||
* @this {import("./Translate.js").default}
|
||||
* @this {Translate}
|
||||
*/
|
||||
function handleUpEvent(event) {
|
||||
if (this.lastCoordinate_) {
|
||||
@@ -282,7 +282,7 @@ function handleUpEvent(event) {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserPointerEvent.js").default} event Event.
|
||||
* @this {import("./Translate.js").default}
|
||||
* @this {Translate}
|
||||
*/
|
||||
function handleDragEvent(event) {
|
||||
if (this.lastCoordinate_) {
|
||||
@@ -309,7 +309,7 @@ function handleDragEvent(event) {
|
||||
|
||||
/**
|
||||
* @param {import("../MapBrowserEvent.js").default} event Event.
|
||||
* @this {import("./Translate.js").default}
|
||||
* @this {Translate}
|
||||
*/
|
||||
function handleMoveEvent(event) {
|
||||
const elem = event.map.getViewport();
|
||||
|
||||
Reference in New Issue
Block a user