Zoom control should not act on a null view
This commit is contained in:
@@ -140,6 +140,11 @@ ol.control.Zoom.prototype.handlePointerUp_ = function(delta, pointerEvent) {
|
|||||||
ol.control.Zoom.prototype.zoomByDelta_ = function(delta) {
|
ol.control.Zoom.prototype.zoomByDelta_ = function(delta) {
|
||||||
var map = this.getMap();
|
var map = this.getMap();
|
||||||
var view = map.getView();
|
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();
|
var currentResolution = view.getResolution();
|
||||||
if (goog.isDef(currentResolution)) {
|
if (goog.isDef(currentResolution)) {
|
||||||
if (this.duration_ > 0) {
|
if (this.duration_ > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user