Merge pull request #7923 from ahocevar/fix-pointer-static
Fix exports and use of constants
This commit is contained in:
@@ -19,7 +19,7 @@ import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
import MultiPoint from '../geom/MultiPoint.js';
|
||||
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||
import MouseSource from '../pointer/MouseSource.js';
|
||||
import {POINTER_TYPE} from '../pointer/MouseSource.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import Polygon, {fromCircle, makeRegular} from '../geom/Polygon.js';
|
||||
import PointerInteraction, {handleEvent as handlePointerEvent} from '../interaction/Pointer.js';
|
||||
@@ -435,7 +435,7 @@ export function handleEvent(event) {
|
||||
pass = event.type === MapBrowserEventType.POINTERMOVE;
|
||||
if (pass && this.freehand_) {
|
||||
pass = this.handlePointerMove_(event);
|
||||
} else if (event.pointerEvent.pointerType == MouseSource.POINTER_TYPE ||
|
||||
} else if (event.pointerEvent.pointerType == POINTER_TYPE ||
|
||||
(event.type === MapBrowserEventType.POINTERDRAG && !this.downTimeout_)) {
|
||||
this.handlePointerMove_(event);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export const POINTER_ID = 1;
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
const POINTER_TYPE = 'mouse';
|
||||
export const POINTER_TYPE = 'mouse';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -199,7 +199,7 @@ inherits(PointerEvent, Event);
|
||||
* Is the `buttons` property supported?
|
||||
* @type {boolean}
|
||||
*/
|
||||
const HAS_BUTTONS = false;
|
||||
let HAS_BUTTONS = false;
|
||||
|
||||
|
||||
/**
|
||||
@@ -269,7 +269,7 @@ PointerEvent.prototype.getPressure_ = function(eventDict, buttons) {
|
||||
(function() {
|
||||
try {
|
||||
const ev = new MouseEvent('click', {buttons: 1});
|
||||
PointerEvent.HAS_BUTTONS = ev.buttons === 1;
|
||||
HAS_BUTTONS = ev.buttons === 1;
|
||||
} catch (e) {
|
||||
// pass
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user