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:
@@ -130,7 +130,7 @@ ol.control.Rotate.prototype.handlePointerUp_ = function(pointerEvent) {
|
||||
ol.control.Rotate.prototype.resetNorth_ = function() {
|
||||
var map = this.getMap();
|
||||
var view = map.getView();
|
||||
goog.asserts.assert(goog.isDef(view));
|
||||
goog.asserts.assert(!goog.isNull(view));
|
||||
var currentRotation = view.getRotation();
|
||||
while (currentRotation < -Math.PI) {
|
||||
currentRotation += 2 * Math.PI;
|
||||
|
||||
Reference in New Issue
Block a user