Make ol.Map#setView do not accept undefined
With this change map.setView(null) is permitted, but map.setView(undefined) is not. map.getView now always returns a defined value, which may be null is setView was called with null.
This commit is contained in:
@@ -70,7 +70,7 @@ ol.interaction.KeyboardPan.prototype.handleMapBrowserEvent =
|
||||
keyCode == goog.events.KeyCodes.UP)) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var view = map.getView();
|
||||
goog.asserts.assert(goog.isDef(view));
|
||||
goog.asserts.assert(!goog.isNull(view));
|
||||
var viewState = view.getState();
|
||||
var mapUnitsDelta = viewState.resolution * this.pixelDelta_;
|
||||
var deltaX = 0, deltaY = 0;
|
||||
|
||||
Reference in New Issue
Block a user