Cast 'originalEvent' in interactions

This commit is contained in:
Frederic Junod
2018-09-05 13:59:12 +02:00
parent f825a08bcf
commit a5f5c06af3
3 changed files with 3 additions and 3 deletions

View File

@@ -55,8 +55,8 @@ class DoubleClickZoom extends Interaction {
*/
function handleEvent(mapBrowserEvent) {
let stopEvent = false;
const browserEvent = mapBrowserEvent.originalEvent;
if (mapBrowserEvent.type == MapBrowserEventType.DBLCLICK) {
const browserEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent);
const map = mapBrowserEvent.map;
const anchor = mapBrowserEvent.coordinate;
const delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;

View File

@@ -92,7 +92,7 @@ class KeyboardPan extends Interaction {
function handleEvent(mapBrowserEvent) {
let stopEvent = false;
if (mapBrowserEvent.type == EventType.KEYDOWN) {
const keyEvent = mapBrowserEvent.originalEvent;
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
const keyCode = keyEvent.keyCode;
if (this.condition_(mapBrowserEvent) &&
(keyCode == KeyCode.DOWN ||

View File

@@ -77,7 +77,7 @@ function handleEvent(mapBrowserEvent) {
let stopEvent = false;
if (mapBrowserEvent.type == EventType.KEYDOWN ||
mapBrowserEvent.type == EventType.KEYPRESS) {
const keyEvent = mapBrowserEvent.originalEvent;
const keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);
const charCode = keyEvent.charCode;
if (this.condition_(mapBrowserEvent) &&
(charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0))) {