Zoom control should not act on a null view

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

View File

@@ -140,6 +140,11 @@ ol.control.Zoom.prototype.handlePointerUp_ = function(delta, pointerEvent) {
ol.control.Zoom.prototype.zoomByDelta_ = function(delta) {
var map = this.getMap();
var view = map.getView();
if (goog.isNull(view)) {
// the map does not have a view, so we can't act
// upon it
return;
}
var currentResolution = view.getResolution();
if (goog.isDef(currentResolution)) {
if (this.duration_ > 0) {