Cast 'originalEvent' in interactions
This commit is contained in:
@@ -55,8 +55,8 @@ class DoubleClickZoom extends Interaction {
|
|||||||
*/
|
*/
|
||||||
function handleEvent(mapBrowserEvent) {
|
function handleEvent(mapBrowserEvent) {
|
||||||
let stopEvent = false;
|
let stopEvent = false;
|
||||||
const browserEvent = mapBrowserEvent.originalEvent;
|
|
||||||
if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {
|
if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {
|
||||||
|
const browserEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);
|
||||||
const map = mapBrowserEvent.map;
|
const map = mapBrowserEvent.map;
|
||||||
const anchor = mapBrowserEvent.coordinate;
|
const anchor = mapBrowserEvent.coordinate;
|
||||||
const delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;
|
const delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class KeyboardPan extends Interaction {
|
|||||||
function handleEvent(mapBrowserEvent) {
|
function handleEvent(mapBrowserEvent) {
|
||||||
let stopEvent = false;
|
let stopEvent = false;
|
||||||
if (mapBrowserEvent.type == EventType.KEYDOWN) {
|
if (mapBrowserEvent.type == EventType.KEYDOWN) {
|
||||||
const keyEvent = mapBrowserEvent.originalEvent;
|
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
|
||||||
const keyCode = keyEvent.keyCode;
|
const keyCode = keyEvent.keyCode;
|
||||||
if (this.condition_(mapBrowserEvent) &&
|
if (this.condition_(mapBrowserEvent) &&
|
||||||
(keyCode == KeyCode.DOWN ||
|
(keyCode == KeyCode.DOWN ||
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function handleEvent(mapBrowserEvent) {
|
|||||||
let stopEvent = false;
|
let stopEvent = false;
|
||||||
if (mapBrowserEvent.type == EventType.KEYDOWN ||
|
if (mapBrowserEvent.type == EventType.KEYDOWN ||
|
||||||
mapBrowserEvent.type == EventType.KEYPRESS) {
|
mapBrowserEvent.type == EventType.KEYPRESS) {
|
||||||
const keyEvent = mapBrowserEvent.originalEvent;
|
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
|
||||||
const charCode = keyEvent.charCode;
|
const charCode = keyEvent.charCode;
|
||||||
if (this.condition_(mapBrowserEvent) &&
|
if (this.condition_(mapBrowserEvent) &&
|
||||||
(charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0))) {
|
(charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user