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:
@@ -54,7 +54,7 @@ goog.inherits(ol.interaction.DragZoom, ol.interaction.DragBox);
|
||||
ol.interaction.DragZoom.prototype.onBoxEnd = function() {
|
||||
var map = this.getMap();
|
||||
var view = map.getView();
|
||||
goog.asserts.assert(goog.isDef(view));
|
||||
goog.asserts.assert(!goog.isNull(view));
|
||||
var extent = this.getGeometry().getExtent();
|
||||
var center = ol.extent.getCenter(extent);
|
||||
var size = map.getSize();
|
||||
|
||||
Reference in New Issue
Block a user