Remove duplicated logic from PointerInteraction

This commit is contained in:
Andreas Hocevar
2022-06-16 11:26:28 +02:00
parent f99dc1e9ec
commit 134ec9c8d0
3 changed files with 49 additions and 52 deletions

View File

@@ -15,9 +15,17 @@ class MapBrowserEvent extends MapEvent {
* @param {import("./PluggableMap.js").default} map Map.
* @param {EVENT} originalEvent Original event.
* @param {boolean} [opt_dragging] Is the map currently being dragged?
* @param {?import("./PluggableMap.js").FrameState} [opt_frameState] Frame state.
* @param {import("./PluggableMap.js").FrameState} [opt_frameState] Frame state.
* @param {Array<PointerEvent>} [opt_activePointers] Active pointers.
*/
constructor(type, map, originalEvent, opt_dragging, opt_frameState) {
constructor(
type,
map,
originalEvent,
opt_dragging,
opt_frameState,
opt_activePointers
) {
super(type, map, opt_frameState);
/**
@@ -48,6 +56,11 @@ class MapBrowserEvent extends MapEvent {
* @api
*/
this.dragging = opt_dragging !== undefined ? opt_dragging : false;
/**
* @type {Array<PointerEvent>|undefined}
*/
this.activePointers = opt_activePointers;
}
/**