This commit is contained in:
60
node_modules/ol/events/Event.d.ts
generated
vendored
Normal file
60
node_modules/ol/events/Event.d.ts
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @param {Event|import("./Event.js").default} evt Event
|
||||
*/
|
||||
export function stopPropagation(evt: Event | import("./Event.js").default): void;
|
||||
/**
|
||||
* @param {Event|import("./Event.js").default} evt Event
|
||||
*/
|
||||
export function preventDefault(evt: Event | import("./Event.js").default): void;
|
||||
export default BaseEvent;
|
||||
/**
|
||||
* @module ol/events/Event
|
||||
*/
|
||||
/**
|
||||
* @classdesc
|
||||
* Stripped down implementation of the W3C DOM Level 2 Event interface.
|
||||
* See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.
|
||||
*
|
||||
* This implementation only provides `type` and `target` properties, and
|
||||
* `stopPropagation` and `preventDefault` methods. It is meant as base class
|
||||
* for higher level events defined in the library, and works with
|
||||
* {@link module:ol/events/Target~Target}.
|
||||
*/
|
||||
declare class BaseEvent {
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
*/
|
||||
constructor(type: string);
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
propagationStopped: boolean;
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
defaultPrevented: boolean;
|
||||
/**
|
||||
* The event type.
|
||||
* @type {string}
|
||||
* @api
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* The event target.
|
||||
* @type {Object}
|
||||
* @api
|
||||
*/
|
||||
target: any;
|
||||
/**
|
||||
* Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events
|
||||
* will be fired.
|
||||
* @api
|
||||
*/
|
||||
preventDefault(): void;
|
||||
/**
|
||||
* Stop event propagation.
|
||||
* @api
|
||||
*/
|
||||
stopPropagation(): void;
|
||||
}
|
||||
//# sourceMappingURL=Event.d.ts.map
|
||||
1
node_modules/ol/events/Event.d.ts.map
generated
vendored
Normal file
1
node_modules/ol/events/Event.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../src/events/Event.js"],"names":[],"mappings":"AA8DA;;GAEG;AACH,qCAFW,KAAK,GAAC,OAAO,YAAY,EAAE,OAAO,QAI5C;AAED;;GAEG;AACH,oCAFW,KAAK,GAAC,OAAO,YAAY,EAAE,OAAO,QAI5C;;AA1ED;;GAEG;AAEH;;;;;;;;;GASG;AACH;IACE;;OAEG;IACH,kBAFW,MAAM,EA0BhB;IAvBC;;OAEG;IACH,oBAFU,OAAO,CAEM;IAEvB;;OAEG;IACH,kBAFU,OAAO,CAEI;IAErB;;;;OAIG;IACH,MAHU,MAAM,CAGA;IAEhB;;;;OAIG;IACH,YAAkB;IAGpB;;;;OAIG;IACH,uBAEC;IAED;;;OAGG;IACH,wBAEC;CACF"}
|
||||
70
node_modules/ol/events/Event.js
generated
vendored
Normal file
70
node_modules/ol/events/Event.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* @module ol/events/Event
|
||||
*/
|
||||
/**
|
||||
* @classdesc
|
||||
* Stripped down implementation of the W3C DOM Level 2 Event interface.
|
||||
* See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.
|
||||
*
|
||||
* This implementation only provides `type` and `target` properties, and
|
||||
* `stopPropagation` and `preventDefault` methods. It is meant as base class
|
||||
* for higher level events defined in the library, and works with
|
||||
* {@link module:ol/events/Target~Target}.
|
||||
*/
|
||||
var BaseEvent = /** @class */ (function () {
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
*/
|
||||
function BaseEvent(type) {
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.propagationStopped;
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.defaultPrevented;
|
||||
/**
|
||||
* The event type.
|
||||
* @type {string}
|
||||
* @api
|
||||
*/
|
||||
this.type = type;
|
||||
/**
|
||||
* The event target.
|
||||
* @type {Object}
|
||||
* @api
|
||||
*/
|
||||
this.target = null;
|
||||
}
|
||||
/**
|
||||
* Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events
|
||||
* will be fired.
|
||||
* @api
|
||||
*/
|
||||
BaseEvent.prototype.preventDefault = function () {
|
||||
this.defaultPrevented = true;
|
||||
};
|
||||
/**
|
||||
* Stop event propagation.
|
||||
* @api
|
||||
*/
|
||||
BaseEvent.prototype.stopPropagation = function () {
|
||||
this.propagationStopped = true;
|
||||
};
|
||||
return BaseEvent;
|
||||
}());
|
||||
/**
|
||||
* @param {Event|import("./Event.js").default} evt Event
|
||||
*/
|
||||
export function stopPropagation(evt) {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
/**
|
||||
* @param {Event|import("./Event.js").default} evt Event
|
||||
*/
|
||||
export function preventDefault(evt) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
export default BaseEvent;
|
||||
//# sourceMappingURL=Event.js.map
|
||||
1
node_modules/ol/events/Event.js.map
generated
vendored
Normal file
1
node_modules/ol/events/Event.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Event.js","sourceRoot":"","sources":["../src/events/Event.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;GASG;AACH;IACE;;OAEG;IACH,mBAAY,IAAI;QACd;;WAEG;QACH,IAAI,CAAC,kBAAkB,CAAC;QAExB;;WAEG;QACH,IAAI,CAAC,gBAAgB,CAAC;QAEtB;;;;WAIG;QACH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB;;;;WAIG;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,kCAAc,GAAd;QACE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,mCAAe,GAAf;QACE,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IACH,gBAAC;AAAD,CAAC,AA9CD,IA8CC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAG;IACjC,GAAG,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAG;IAChC,GAAG,CAAC,cAAc,EAAE,CAAC;AACvB,CAAC;AAED,eAAe,SAAS,CAAC"}
|
||||
21
node_modules/ol/events/EventType.d.ts
generated
vendored
Normal file
21
node_modules/ol/events/EventType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
declare namespace _default {
|
||||
const CHANGE: string;
|
||||
const ERROR: string;
|
||||
const BLUR: string;
|
||||
const CLEAR: string;
|
||||
const CONTEXTMENU: string;
|
||||
const CLICK: string;
|
||||
const DBLCLICK: string;
|
||||
const DRAGENTER: string;
|
||||
const DRAGOVER: string;
|
||||
const DROP: string;
|
||||
const FOCUS: string;
|
||||
const KEYDOWN: string;
|
||||
const KEYPRESS: string;
|
||||
const LOAD: string;
|
||||
const RESIZE: string;
|
||||
const TOUCHMOVE: string;
|
||||
const WHEEL: string;
|
||||
}
|
||||
export default _default;
|
||||
//# sourceMappingURL=EventType.d.ts.map
|
||||
1
node_modules/ol/events/EventType.d.ts.map
generated
vendored
Normal file
1
node_modules/ol/events/EventType.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EventType.d.ts","sourceRoot":"","sources":["../src/events/EventType.js"],"names":[],"mappings":""}
|
||||
37
node_modules/ol/events/EventType.js
generated
vendored
Normal file
37
node_modules/ol/events/EventType.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @module ol/events/EventType
|
||||
*/
|
||||
/**
|
||||
* @enum {string}
|
||||
* @const
|
||||
*/
|
||||
export default {
|
||||
/**
|
||||
* Generic change event. Triggered when the revision counter is increased.
|
||||
* @event module:ol/events/Event~BaseEvent#change
|
||||
* @api
|
||||
*/
|
||||
CHANGE: 'change',
|
||||
/**
|
||||
* Generic error event. Triggered when an error occurs.
|
||||
* @event module:ol/events/Event~BaseEvent#error
|
||||
* @api
|
||||
*/
|
||||
ERROR: 'error',
|
||||
BLUR: 'blur',
|
||||
CLEAR: 'clear',
|
||||
CONTEXTMENU: 'contextmenu',
|
||||
CLICK: 'click',
|
||||
DBLCLICK: 'dblclick',
|
||||
DRAGENTER: 'dragenter',
|
||||
DRAGOVER: 'dragover',
|
||||
DROP: 'drop',
|
||||
FOCUS: 'focus',
|
||||
KEYDOWN: 'keydown',
|
||||
KEYPRESS: 'keypress',
|
||||
LOAD: 'load',
|
||||
RESIZE: 'resize',
|
||||
TOUCHMOVE: 'touchmove',
|
||||
WHEEL: 'wheel',
|
||||
};
|
||||
//# sourceMappingURL=EventType.js.map
|
||||
1
node_modules/ol/events/EventType.js.map
generated
vendored
Normal file
1
node_modules/ol/events/EventType.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EventType.js","sourceRoot":"","sources":["../src/events/EventType.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,eAAe;IACb;;;;OAIG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;;OAIG;IACH,KAAK,EAAE,OAAO;IAEd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;CACf,CAAC"}
|
||||
8
node_modules/ol/events/KeyCode.d.ts
generated
vendored
Normal file
8
node_modules/ol/events/KeyCode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
declare namespace _default {
|
||||
const LEFT: number;
|
||||
const UP: number;
|
||||
const RIGHT: number;
|
||||
const DOWN: number;
|
||||
}
|
||||
export default _default;
|
||||
//# sourceMappingURL=KeyCode.d.ts.map
|
||||
1
node_modules/ol/events/KeyCode.d.ts.map
generated
vendored
Normal file
1
node_modules/ol/events/KeyCode.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"KeyCode.d.ts","sourceRoot":"","sources":["../src/events/KeyCode.js"],"names":[],"mappings":""}
|
||||
14
node_modules/ol/events/KeyCode.js
generated
vendored
Normal file
14
node_modules/ol/events/KeyCode.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @module ol/events/KeyCode
|
||||
*/
|
||||
/**
|
||||
* @enum {number}
|
||||
* @const
|
||||
*/
|
||||
export default {
|
||||
LEFT: 37,
|
||||
UP: 38,
|
||||
RIGHT: 39,
|
||||
DOWN: 40,
|
||||
};
|
||||
//# sourceMappingURL=KeyCode.js.map
|
||||
1
node_modules/ol/events/KeyCode.js.map
generated
vendored
Normal file
1
node_modules/ol/events/KeyCode.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"KeyCode.js","sourceRoot":"","sources":["../src/events/KeyCode.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,eAAe;IACb,IAAI,EAAE,EAAE;IACR,EAAE,EAAE,EAAE;IACN,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;CACT,CAAC"}
|
||||
83
node_modules/ol/events/Target.d.ts
generated
vendored
Normal file
83
node_modules/ol/events/Target.d.ts
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
export default Target;
|
||||
export type EventTargetLike = EventTarget | Target;
|
||||
/**
|
||||
* @typedef {EventTarget|Target} EventTargetLike
|
||||
*/
|
||||
/**
|
||||
* @classdesc
|
||||
* A simplified implementation of the W3C DOM Level 2 EventTarget interface.
|
||||
* See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.
|
||||
*
|
||||
* There are two important simplifications compared to the specification:
|
||||
*
|
||||
* 1. The handling of `useCapture` in `addEventListener` and
|
||||
* `removeEventListener`. There is no real capture model.
|
||||
* 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.
|
||||
* There is no event target hierarchy. When a listener calls
|
||||
* `stopPropagation` or `preventDefault` on an event object, it means that no
|
||||
* more listeners after this one will be called. Same as when the listener
|
||||
* returns false.
|
||||
*/
|
||||
declare class Target extends Disposable {
|
||||
/**
|
||||
* @param {*} [opt_target] Default event target for dispatched events.
|
||||
*/
|
||||
constructor(opt_target?: any);
|
||||
/**
|
||||
* @private
|
||||
* @type {*}
|
||||
*/
|
||||
private eventTarget_;
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, number>}
|
||||
*/
|
||||
private pendingRemovals_;
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, number>}
|
||||
*/
|
||||
private dispatching_;
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, Array<import("../events.js").Listener>>}
|
||||
*/
|
||||
private listeners_;
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
* @param {import("../events.js").Listener} listener Listener.
|
||||
*/
|
||||
addEventListener(type: string, listener: import("../events.js").Listener): void;
|
||||
/**
|
||||
* Dispatches an event and calls all listeners listening for events
|
||||
* of this type. The event parameter can either be a string or an
|
||||
* Object with a `type` property.
|
||||
*
|
||||
* @param {import("./Event.js").default|string} event Event object.
|
||||
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
||||
* event object or if any of the listeners returned false.
|
||||
* @api
|
||||
*/
|
||||
dispatchEvent(event: import("./Event.js").default | string): boolean | undefined;
|
||||
/**
|
||||
* Get the listeners for a specified event type. Listeners are returned in the
|
||||
* order that they will be called in.
|
||||
*
|
||||
* @param {string} type Type.
|
||||
* @return {Array<import("../events.js").Listener>|undefined} Listeners.
|
||||
*/
|
||||
getListeners(type: string): Array<import("../events.js").Listener> | undefined;
|
||||
/**
|
||||
* @param {string} [opt_type] Type. If not provided,
|
||||
* `true` will be returned if this event target has any listeners.
|
||||
* @return {boolean} Has listeners.
|
||||
*/
|
||||
hasListener(opt_type?: string | undefined): boolean;
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
* @param {import("../events.js").Listener} listener Listener.
|
||||
*/
|
||||
removeEventListener(type: string, listener: import("../events.js").Listener): void;
|
||||
}
|
||||
import Disposable from "../Disposable.js";
|
||||
//# sourceMappingURL=Target.d.ts.map
|
||||
1
node_modules/ol/events/Target.d.ts.map
generated
vendored
Normal file
1
node_modules/ol/events/Target.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Target.d.ts","sourceRoot":"","sources":["../src/events/Target.js"],"names":[],"mappings":";8BASa,WAAW,GAAC,MAAM;AAD/B;;GAEG;AAEH;;;;;;;;;;;;;;GAcG;AACH;IACE;;OAEG;IACH,8BA0BC;IAvBC;;;OAGG;IACH,qBAA8B;IAE9B;;;OAGG;IACH,yBAA4B;IAE5B;;;OAGG;IACH,qBAAwB;IAExB;;;OAGG;IACH,mBAAsB;IAGxB;;;OAGG;IACH,uBAHW,MAAM,YACN,OAAO,cAAc,EAAE,QAAQ,QAWzC;IAED;;;;;;;;;OASG;IACH,qBALW,OAAO,YAAY,EAAE,OAAO,GAAC,MAAM,GAClC,OAAO,GAAC,SAAS,CAiD5B;IASD;;;;;;OAMG;IACH,mBAHW,MAAM,GACL,MAAM,OAAO,cAAc,EAAE,QAAQ,CAAC,GAAC,SAAS,CAI3D;IAED;;;;OAIG;IACH,4CAFY,OAAO,CASlB;IAED;;;OAGG;IACH,0BAHW,MAAM,YACN,OAAO,cAAc,EAAE,QAAQ,QAmBzC;CACF"}
|
||||
190
node_modules/ol/events/Target.js
generated
vendored
Normal file
190
node_modules/ol/events/Target.js
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
/**
|
||||
* @module ol/events/Target
|
||||
*/
|
||||
import Disposable from '../Disposable.js';
|
||||
import Event from './Event.js';
|
||||
import { VOID } from '../functions.js';
|
||||
import { clear } from '../obj.js';
|
||||
/**
|
||||
* @typedef {EventTarget|Target} EventTargetLike
|
||||
*/
|
||||
/**
|
||||
* @classdesc
|
||||
* A simplified implementation of the W3C DOM Level 2 EventTarget interface.
|
||||
* See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.
|
||||
*
|
||||
* There are two important simplifications compared to the specification:
|
||||
*
|
||||
* 1. The handling of `useCapture` in `addEventListener` and
|
||||
* `removeEventListener`. There is no real capture model.
|
||||
* 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.
|
||||
* There is no event target hierarchy. When a listener calls
|
||||
* `stopPropagation` or `preventDefault` on an event object, it means that no
|
||||
* more listeners after this one will be called. Same as when the listener
|
||||
* returns false.
|
||||
*/
|
||||
var Target = /** @class */ (function (_super) {
|
||||
__extends(Target, _super);
|
||||
/**
|
||||
* @param {*} [opt_target] Default event target for dispatched events.
|
||||
*/
|
||||
function Target(opt_target) {
|
||||
var _this = _super.call(this) || this;
|
||||
/**
|
||||
* @private
|
||||
* @type {*}
|
||||
*/
|
||||
_this.eventTarget_ = opt_target;
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, number>}
|
||||
*/
|
||||
_this.pendingRemovals_ = null;
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, number>}
|
||||
*/
|
||||
_this.dispatching_ = null;
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, Array<import("../events.js").Listener>>}
|
||||
*/
|
||||
_this.listeners_ = null;
|
||||
return _this;
|
||||
}
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
* @param {import("../events.js").Listener} listener Listener.
|
||||
*/
|
||||
Target.prototype.addEventListener = function (type, listener) {
|
||||
if (!type || !listener) {
|
||||
return;
|
||||
}
|
||||
var listeners = this.listeners_ || (this.listeners_ = {});
|
||||
var listenersForType = listeners[type] || (listeners[type] = []);
|
||||
if (listenersForType.indexOf(listener) === -1) {
|
||||
listenersForType.push(listener);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Dispatches an event and calls all listeners listening for events
|
||||
* of this type. The event parameter can either be a string or an
|
||||
* Object with a `type` property.
|
||||
*
|
||||
* @param {import("./Event.js").default|string} event Event object.
|
||||
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
||||
* event object or if any of the listeners returned false.
|
||||
* @api
|
||||
*/
|
||||
Target.prototype.dispatchEvent = function (event) {
|
||||
var isString = typeof event === 'string';
|
||||
var type = isString ? event : event.type;
|
||||
var listeners = this.listeners_ && this.listeners_[type];
|
||||
if (!listeners) {
|
||||
return;
|
||||
}
|
||||
var evt = isString ? new Event(event) : /** @type {Event} */ (event);
|
||||
if (!evt.target) {
|
||||
evt.target = this.eventTarget_ || this;
|
||||
}
|
||||
var dispatching = this.dispatching_ || (this.dispatching_ = {});
|
||||
var pendingRemovals = this.pendingRemovals_ || (this.pendingRemovals_ = {});
|
||||
if (!(type in dispatching)) {
|
||||
dispatching[type] = 0;
|
||||
pendingRemovals[type] = 0;
|
||||
}
|
||||
++dispatching[type];
|
||||
var propagate;
|
||||
for (var i = 0, ii = listeners.length; i < ii; ++i) {
|
||||
if ('handleEvent' in listeners[i]) {
|
||||
propagate = /** @type {import("../events.js").ListenerObject} */ (listeners[i]).handleEvent(evt);
|
||||
}
|
||||
else {
|
||||
propagate = /** @type {import("../events.js").ListenerFunction} */ (listeners[i]).call(this, evt);
|
||||
}
|
||||
if (propagate === false || evt.propagationStopped) {
|
||||
propagate = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (--dispatching[type] === 0) {
|
||||
var pr = pendingRemovals[type];
|
||||
delete pendingRemovals[type];
|
||||
while (pr--) {
|
||||
this.removeEventListener(type, VOID);
|
||||
}
|
||||
delete dispatching[type];
|
||||
}
|
||||
return propagate;
|
||||
};
|
||||
/**
|
||||
* Clean up.
|
||||
*/
|
||||
Target.prototype.disposeInternal = function () {
|
||||
this.listeners_ && clear(this.listeners_);
|
||||
};
|
||||
/**
|
||||
* Get the listeners for a specified event type. Listeners are returned in the
|
||||
* order that they will be called in.
|
||||
*
|
||||
* @param {string} type Type.
|
||||
* @return {Array<import("../events.js").Listener>|undefined} Listeners.
|
||||
*/
|
||||
Target.prototype.getListeners = function (type) {
|
||||
return (this.listeners_ && this.listeners_[type]) || undefined;
|
||||
};
|
||||
/**
|
||||
* @param {string} [opt_type] Type. If not provided,
|
||||
* `true` will be returned if this event target has any listeners.
|
||||
* @return {boolean} Has listeners.
|
||||
*/
|
||||
Target.prototype.hasListener = function (opt_type) {
|
||||
if (!this.listeners_) {
|
||||
return false;
|
||||
}
|
||||
return opt_type
|
||||
? opt_type in this.listeners_
|
||||
: Object.keys(this.listeners_).length > 0;
|
||||
};
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
* @param {import("../events.js").Listener} listener Listener.
|
||||
*/
|
||||
Target.prototype.removeEventListener = function (type, listener) {
|
||||
var listeners = this.listeners_ && this.listeners_[type];
|
||||
if (listeners) {
|
||||
var index = listeners.indexOf(listener);
|
||||
if (index !== -1) {
|
||||
if (this.pendingRemovals_ && type in this.pendingRemovals_) {
|
||||
// make listener a no-op, and remove later in #dispatchEvent()
|
||||
listeners[index] = VOID;
|
||||
++this.pendingRemovals_[type];
|
||||
}
|
||||
else {
|
||||
listeners.splice(index, 1);
|
||||
if (listeners.length === 0) {
|
||||
delete this.listeners_[type];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return Target;
|
||||
}(Disposable));
|
||||
export default Target;
|
||||
//# sourceMappingURL=Target.js.map
|
||||
1
node_modules/ol/events/Target.js.map
generated
vendored
Normal file
1
node_modules/ol/events/Target.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Target.js","sourceRoot":"","sources":["../src/events/Target.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;GAEG;AACH,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAC,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAEhC;;GAEG;AAEH;;;;;;;;;;;;;;GAcG;AACH;IAAqB,0BAAU;IAC7B;;OAEG;IACH,gBAAY,UAAU;QAAtB,YACE,iBAAO,SAyBR;QAvBC;;;WAGG;QACH,KAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAE/B;;;WAGG;QACH,KAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAE7B;;;WAGG;QACH,KAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB;;;WAGG;QACH,KAAI,CAAC,UAAU,GAAG,IAAI,CAAC;;IACzB,CAAC;IAED;;;OAGG;IACH,iCAAgB,GAAhB,UAAiB,IAAI,EAAE,QAAQ;QAC7B,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACtB,OAAO;SACR;QACD,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC;QAC5D,IAAM,gBAAgB,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,I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QAAQ;YACb,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,UAAU;YAC7B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,oCAAmB,GAAnB,UAAoB,IAAI,EAAE,QAAQ;QAChC,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,SAAS,EAAE;YACb,IAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC1C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBAChB,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,IAAI,IAAI,CAAC,gBAAgB,EAAE;oBAC1D,8DAA8D;oBAC9D,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;oBACxB,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;iBAC/B;qBAAM;oBACL,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oBAC3B,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;wBAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;qBAC9B;iBACF;aACF;SACF;IACH,CAAC;IACH,aAAC;AAAD,CAAC,AA9JD,CAAqB,UAAU,GA8J9B;AAED,eAAe,MAAM,CAAC"}
|
||||
53
node_modules/ol/events/condition.d.ts
generated
vendored
Normal file
53
node_modules/ol/events/condition.d.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
||||
* `{boolean}`. If the condition is met, true should be returned.
|
||||
*
|
||||
* @typedef {function(this: ?, import("../MapBrowserEvent.js").default): boolean} Condition
|
||||
*/
|
||||
/**
|
||||
* Creates a condition function that passes when all provided conditions pass.
|
||||
* @param {...Condition} var_args Conditions to check.
|
||||
* @return {Condition} Condition function.
|
||||
*/
|
||||
export function all(...args: Condition[]): Condition;
|
||||
export function altKeyOnly(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function altShiftKeysOnly(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function focus(event: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function focusWithTabindex(event: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
/**
|
||||
* Return always true.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True.
|
||||
* @api
|
||||
*/
|
||||
export const always: typeof TRUE;
|
||||
export function click(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function mouseActionButton(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
/**
|
||||
* Return always false.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} False.
|
||||
* @api
|
||||
*/
|
||||
export const never: typeof FALSE;
|
||||
export function pointerMove(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function singleClick(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function doubleClick(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function noModifierKeys(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function platformModifierKeyOnly(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function shiftKeyOnly(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function targetNotEditable(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function mouseOnly(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function touchOnly(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function penOnly(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
export function primaryAction(mapBrowserEvent: import("../MapBrowserEvent.js").default<any>): boolean;
|
||||
/**
|
||||
* A function that takes an {@link module :ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
||||
* `{boolean}`. If the condition is met, true should be returned.
|
||||
*/
|
||||
export type Condition = (this: unknown, arg1: import("../MapBrowserEvent.js").default<any>) => boolean;
|
||||
import { TRUE } from "../functions.js";
|
||||
import { FALSE } from "../functions.js";
|
||||
//# sourceMappingURL=condition.d.ts.map
|
||||
1
node_modules/ol/events/condition.d.ts.map
generated
vendored
Normal file
1
node_modules/ol/events/condition.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../src/events/condition.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AAEH;;;;GAIG;AACH,2CAFY,SAAS,CAkBpB;AAUM,2FAHK,OAAO,CAYlB;AAUM,iGAHK,OAAO,CAYlB;AAUM,4EAHK,OAAO,CAOlB;AAQM,wFAFK,OAAO,CAMlB;AAED;;;;;;GAMG;AACH,iCAA2B;AASpB,sFAHK,OAAO,CAKlB;AAWM,kGAFK,OAAO,CAOlB;AAED;;;;;;GAMG;AACH,iCAA2B;AAUpB,4FAHK,OAAO,CAKlB;AASM,4FAHK,OAAO,CAKlB;AASM,4FAHK,OAAO,CAKlB;AAUM,+FAHK,OAAO,CAYlB;AAWM,wGAHK,OAAO,CAYlB;AAUM,6FAHK,OAAO,CAYlB;AAWM,kGAHK,OAAO,CAiBlB;AASM,0FAHK,OAAO,CAUlB;AASM,0FAHK,OAAO,CAUlB;AASM,wFAHK,OAAO,CAUlB;AAWM,8FAHK,OAAO,CASlB;;;;;+FA3TwE,OAAO"}
|
||||
274
node_modules/ol/events/condition.js
generated
vendored
Normal file
274
node_modules/ol/events/condition.js
generated
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
/**
|
||||
* @module ol/events/condition
|
||||
*/
|
||||
import MapBrowserEventType from '../MapBrowserEventType.js';
|
||||
import { FALSE, TRUE } from '../functions.js';
|
||||
import { MAC, WEBKIT } from '../has.js';
|
||||
import { assert } from '../asserts.js';
|
||||
/**
|
||||
* A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
||||
* `{boolean}`. If the condition is met, true should be returned.
|
||||
*
|
||||
* @typedef {function(this: ?, import("../MapBrowserEvent.js").default): boolean} Condition
|
||||
*/
|
||||
/**
|
||||
* Creates a condition function that passes when all provided conditions pass.
|
||||
* @param {...Condition} var_args Conditions to check.
|
||||
* @return {Condition} Condition function.
|
||||
*/
|
||||
export function all(var_args) {
|
||||
var conditions = arguments;
|
||||
/**
|
||||
* @param {import("../MapBrowserEvent.js").default} event Event.
|
||||
* @return {boolean} All conditions passed.
|
||||
*/
|
||||
return function (event) {
|
||||
var pass = true;
|
||||
for (var i = 0, ii = conditions.length; i < ii; ++i) {
|
||||
pass = pass && conditions[i](event);
|
||||
if (!pass) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return pass;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
|
||||
* additionally the shift-key is pressed).
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the alt key is pressed.
|
||||
* @api
|
||||
*/
|
||||
export var altKeyOnly = function (mapBrowserEvent) {
|
||||
var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
||||
return (originalEvent.altKey &&
|
||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||
!originalEvent.shiftKey);
|
||||
};
|
||||
/**
|
||||
* Return `true` if only the alt-key and shift-key is pressed, `false` otherwise
|
||||
* (e.g. when additionally the platform-modifier-key is pressed).
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the alt and shift keys are pressed.
|
||||
* @api
|
||||
*/
|
||||
export var altShiftKeysOnly = function (mapBrowserEvent) {
|
||||
var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
||||
return (originalEvent.altKey &&
|
||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||
originalEvent.shiftKey);
|
||||
};
|
||||
/**
|
||||
* Return `true` if the map has the focus. This condition requires a map target
|
||||
* element with a `tabindex` attribute, e.g. `<div id="map" tabindex="1">`.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} event Map browser event.
|
||||
* @return {boolean} The map has the focus.
|
||||
* @api
|
||||
*/
|
||||
export var focus = function (event) {
|
||||
var targetElement = event.map.getTargetElement();
|
||||
var activeElement = event.map.getOwnerDocument().activeElement;
|
||||
return targetElement.contains(activeElement);
|
||||
};
|
||||
/**
|
||||
* Return `true` if the map has the focus or no 'tabindex' attribute set.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} event Map browser event.
|
||||
* @return {boolean} The map container has the focus or no 'tabindex' attribute.
|
||||
*/
|
||||
export var focusWithTabindex = function (event) {
|
||||
return event.map.getTargetElement().hasAttribute('tabindex')
|
||||
? focus(event)
|
||||
: true;
|
||||
};
|
||||
/**
|
||||
* Return always true.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True.
|
||||
* @api
|
||||
*/
|
||||
export var always = TRUE;
|
||||
/**
|
||||
* Return `true` if the event is a `click` event, `false` otherwise.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `click` event.
|
||||
* @api
|
||||
*/
|
||||
export var click = function (mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == MapBrowserEventType.CLICK;
|
||||
};
|
||||
/**
|
||||
* Return `true` if the event has an "action"-producing mouse button.
|
||||
*
|
||||
* By definition, this includes left-click on windows/linux, and left-click
|
||||
* without the ctrl key on Macs.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} The result.
|
||||
*/
|
||||
export var mouseActionButton = function (mapBrowserEvent) {
|
||||
var originalEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);
|
||||
return originalEvent.button == 0 && !(WEBKIT && MAC && originalEvent.ctrlKey);
|
||||
};
|
||||
/**
|
||||
* Return always false.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} False.
|
||||
* @api
|
||||
*/
|
||||
export var never = FALSE;
|
||||
/**
|
||||
* Return `true` if the browser event is a `pointermove` event, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the browser event is a `pointermove` event.
|
||||
* @api
|
||||
*/
|
||||
export var pointerMove = function (mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == 'pointermove';
|
||||
};
|
||||
/**
|
||||
* Return `true` if the event is a map `singleclick` event, `false` otherwise.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `singleclick` event.
|
||||
* @api
|
||||
*/
|
||||
export var singleClick = function (mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == MapBrowserEventType.SINGLECLICK;
|
||||
};
|
||||
/**
|
||||
* Return `true` if the event is a map `dblclick` event, `false` otherwise.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `dblclick` event.
|
||||
* @api
|
||||
*/
|
||||
export var doubleClick = function (mapBrowserEvent) {
|
||||
return mapBrowserEvent.type == MapBrowserEventType.DBLCLICK;
|
||||
};
|
||||
/**
|
||||
* Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
|
||||
* pressed.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True only if there no modifier keys are pressed.
|
||||
* @api
|
||||
*/
|
||||
export var noModifierKeys = function (mapBrowserEvent) {
|
||||
var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
||||
return (!originalEvent.altKey &&
|
||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||
!originalEvent.shiftKey);
|
||||
};
|
||||
/**
|
||||
* Return `true` if only the platform-modifier-key (the meta-key on Mac,
|
||||
* ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally
|
||||
* the shift-key is pressed).
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the platform modifier key is pressed.
|
||||
* @api
|
||||
*/
|
||||
export var platformModifierKeyOnly = function (mapBrowserEvent) {
|
||||
var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
||||
return (!originalEvent.altKey &&
|
||||
(MAC ? originalEvent.metaKey : originalEvent.ctrlKey) &&
|
||||
!originalEvent.shiftKey);
|
||||
};
|
||||
/**
|
||||
* Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when
|
||||
* additionally the alt-key is pressed).
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the shift key is pressed.
|
||||
* @api
|
||||
*/
|
||||
export var shiftKeyOnly = function (mapBrowserEvent) {
|
||||
var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
||||
return (!originalEvent.altKey &&
|
||||
!(originalEvent.metaKey || originalEvent.ctrlKey) &&
|
||||
originalEvent.shiftKey);
|
||||
};
|
||||
/**
|
||||
* Return `true` if the target element is not editable, i.e. not an `input`,
|
||||
* `select`, or `textarea` element and no `contenteditable` attribute is
|
||||
* set or inherited, `false` otherwise.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True only if the target element is not editable.
|
||||
* @api
|
||||
*/
|
||||
export var targetNotEditable = function (mapBrowserEvent) {
|
||||
var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent);
|
||||
var tagName = /** @type {Element} */ (originalEvent.target).tagName;
|
||||
return (tagName !== 'INPUT' &&
|
||||
tagName !== 'SELECT' &&
|
||||
tagName !== 'TEXTAREA' &&
|
||||
// `isContentEditable` is only available on `HTMLElement`, but it may also be a
|
||||
// different type like `SVGElement`.
|
||||
// @ts-ignore
|
||||
!originalEvent.target.isContentEditable);
|
||||
};
|
||||
/**
|
||||
* Return `true` if the event originates from a mouse device.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a mouse device.
|
||||
* @api
|
||||
*/
|
||||
export var mouseOnly = function (mapBrowserEvent) {
|
||||
var pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent).originalEvent;
|
||||
assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||
return pointerEvent.pointerType == 'mouse';
|
||||
};
|
||||
/**
|
||||
* Return `true` if the event originates from a touchable device.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a touchable device.
|
||||
* @api
|
||||
*/
|
||||
export var touchOnly = function (mapBrowserEvent) {
|
||||
var pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent).originalEvent;
|
||||
assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||
return pointerEvt.pointerType === 'touch';
|
||||
};
|
||||
/**
|
||||
* Return `true` if the event originates from a digital pen.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a digital pen.
|
||||
* @api
|
||||
*/
|
||||
export var penOnly = function (mapBrowserEvent) {
|
||||
var pointerEvt = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent).originalEvent;
|
||||
assert(pointerEvt !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||
// see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||
return pointerEvt.pointerType === 'pen';
|
||||
};
|
||||
/**
|
||||
* Return `true` if the event originates from a primary pointer in
|
||||
* contact with the surface or if the left mouse button is pressed.
|
||||
* See https://www.w3.org/TR/pointerevents/#button-states.
|
||||
*
|
||||
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a primary pointer.
|
||||
* @api
|
||||
*/
|
||||
export var primaryAction = function (mapBrowserEvent) {
|
||||
var pointerEvent = /** @type {import("../MapBrowserEvent").default} */ (mapBrowserEvent).originalEvent;
|
||||
assert(pointerEvent !== undefined, 56); // mapBrowserEvent must originate from a pointer event
|
||||
return pointerEvent.isPrimary && pointerEvent.button === 0;
|
||||
};
|
||||
//# sourceMappingURL=condition.js.map
|
||||
1
node_modules/ol/events/condition.js.map
generated
vendored
Normal file
1
node_modules/ol/events/condition.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../src/events/condition.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,mBAAmB,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,GAA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