Rotate control should not act on a null view

This commit is contained in:
Éric Lemoine
2014-09-17 13:32:31 +02:00
parent 8660f00917
commit 79932ee2f2

View File

@@ -130,7 +130,11 @@ 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.isNull(view));
if (goog.isNull(view)) {
// the map does not have a view, so we can't act
// upon it
return;
}
var currentRotation = view.getRotation();
while (currentRotation < -Math.PI) {
currentRotation += 2 * Math.PI;