Fix non-view-related typecasts in interactions
This commit is contained in:
@@ -111,7 +111,7 @@ ol.interaction.Drag.prototype.handleMapBrowserEvent =
|
||||
this.deltaY = 0;
|
||||
this.startCenter = /** @type {!ol.Coordinate} */ map.getCenter();
|
||||
this.startCoordinate = /** @type {ol.Coordinate} */
|
||||
mapBrowserEvent.getCoordinate();
|
||||
(mapBrowserEvent.getCoordinate());
|
||||
var handled = this.handleDragStart(mapBrowserEvent);
|
||||
if (handled) {
|
||||
this.dragging_ = true;
|
||||
|
||||
@@ -43,7 +43,7 @@ ol.interaction.Keyboard.prototype.handleMapBrowserEvent =
|
||||
function(mapBrowserEvent) {
|
||||
if (mapBrowserEvent.type == goog.events.KeyHandler.EventType.KEY) {
|
||||
var keyEvent = /** @type {goog.events.KeyEvent} */
|
||||
mapBrowserEvent.browserEvent;
|
||||
(mapBrowserEvent.browserEvent);
|
||||
var callback = this.charCodeCallbacks_[keyEvent.charCode];
|
||||
if (callback) {
|
||||
callback();
|
||||
|
||||
@@ -32,7 +32,7 @@ ol.interaction.KeyboardPan.prototype.handleMapBrowserEvent =
|
||||
function(mapBrowserEvent) {
|
||||
if (mapBrowserEvent.type == goog.events.KeyHandler.EventType.KEY) {
|
||||
var keyEvent = /** @type {goog.events.KeyEvent} */
|
||||
mapBrowserEvent.browserEvent;
|
||||
(mapBrowserEvent.browserEvent);
|
||||
var keyCode = keyEvent.keyCode;
|
||||
if (keyCode == goog.events.KeyCodes.DOWN ||
|
||||
keyCode == goog.events.KeyCodes.LEFT ||
|
||||
|
||||
@@ -23,7 +23,7 @@ ol.interaction.KeyboardZoom.prototype.handleMapBrowserEvent =
|
||||
function(mapBrowserEvent) {
|
||||
if (mapBrowserEvent.type == goog.events.KeyHandler.EventType.KEY) {
|
||||
var keyEvent = /** @type {goog.events.KeyEvent} */
|
||||
mapBrowserEvent.browserEvent;
|
||||
(mapBrowserEvent.browserEvent);
|
||||
var charCode = keyEvent.charCode;
|
||||
if (charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0)) {
|
||||
var map = mapBrowserEvent.map;
|
||||
|
||||
@@ -32,7 +32,7 @@ ol.interaction.MouseWheelZoom.prototype.handleMapBrowserEvent =
|
||||
goog.events.MouseWheelHandler.EventType.MOUSEWHEEL) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var mouseWheelEvent = /** @type {goog.events.MouseWheelEvent} */
|
||||
mapBrowserEvent.browserEvent;
|
||||
(mapBrowserEvent.browserEvent);
|
||||
goog.asserts.assert(mouseWheelEvent instanceof goog.events.MouseWheelEvent);
|
||||
var anchor = mapBrowserEvent.getCoordinate();
|
||||
var delta = mouseWheelEvent.deltaY < 0 ? this.delta_ : -this.delta_;
|
||||
|
||||
Reference in New Issue
Block a user