diff --git a/src/ol/control/rotatecontrol.js b/src/ol/control/rotatecontrol.js index db3fc47ef5..2ccddc86cd 100644 --- a/src/ol/control/rotatecontrol.js +++ b/src/ol/control/rotatecontrol.js @@ -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; diff --git a/src/ol/interaction/doubleclickzoominteraction.js b/src/ol/interaction/doubleclickzoominteraction.js index 8b43696863..e840045e8d 100644 --- a/src/ol/interaction/doubleclickzoominteraction.js +++ b/src/ol/interaction/doubleclickzoominteraction.js @@ -50,7 +50,7 @@ ol.interaction.DoubleClickZoom.prototype.handleMapBrowserEvent = var anchor = mapBrowserEvent.coordinate; var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_; var view = map.getView(); - goog.asserts.assert(goog.isDef(view)); + goog.asserts.assert(!goog.isNull(view)); ol.interaction.Interaction.zoomByDelta( map, view, delta, anchor, this.duration_); mapBrowserEvent.preventDefault(); diff --git a/src/ol/interaction/draganddropinteraction.js b/src/ol/interaction/draganddropinteraction.js index 0e4f590ad3..7ad970635d 100644 --- a/src/ol/interaction/draganddropinteraction.js +++ b/src/ol/interaction/draganddropinteraction.js @@ -100,7 +100,7 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, result) { var projection = this.reprojectTo_; if (goog.isNull(projection)) { var view = map.getView(); - goog.asserts.assert(goog.isDef(view)); + goog.asserts.assert(!goog.isNull(view)); projection = view.getProjection(); goog.asserts.assert(goog.isDef(projection)); } diff --git a/src/ol/interaction/dragzoominteraction.js b/src/ol/interaction/dragzoominteraction.js index 6074caba7b..db190f2111 100644 --- a/src/ol/interaction/dragzoominteraction.js +++ b/src/ol/interaction/dragzoominteraction.js @@ -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(); diff --git a/src/ol/interaction/keyboardpaninteraction.js b/src/ol/interaction/keyboardpaninteraction.js index c49aa6f1e3..62dab76038 100644 --- a/src/ol/interaction/keyboardpaninteraction.js +++ b/src/ol/interaction/keyboardpaninteraction.js @@ -70,7 +70,7 @@ ol.interaction.KeyboardPan.prototype.handleMapBrowserEvent = keyCode == goog.events.KeyCodes.UP)) { var map = mapBrowserEvent.map; var view = map.getView(); - goog.asserts.assert(goog.isDef(view)); + goog.asserts.assert(!goog.isNull(view)); var viewState = view.getState(); var mapUnitsDelta = viewState.resolution * this.pixelDelta_; var deltaX = 0, deltaY = 0; diff --git a/src/ol/interaction/keyboardzoominteraction.js b/src/ol/interaction/keyboardzoominteraction.js index 830aa4de60..a629ae8ff8 100644 --- a/src/ol/interaction/keyboardzoominteraction.js +++ b/src/ol/interaction/keyboardzoominteraction.js @@ -70,7 +70,7 @@ ol.interaction.KeyboardZoom.prototype.handleMapBrowserEvent = var delta = (charCode == '+'.charCodeAt(0)) ? this.delta_ : -this.delta_; map.render(); var view = map.getView(); - goog.asserts.assert(goog.isDef(view)); + goog.asserts.assert(!goog.isNull(view)); ol.interaction.Interaction.zoomByDelta( map, view, delta, undefined, this.duration_); mapBrowserEvent.preventDefault(); diff --git a/src/ol/interaction/mousewheelzoominteraction.js b/src/ol/interaction/mousewheelzoominteraction.js index 9702bb3701..0e0f713d18 100644 --- a/src/ol/interaction/mousewheelzoominteraction.js +++ b/src/ol/interaction/mousewheelzoominteraction.js @@ -101,7 +101,7 @@ ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) { var delta = goog.math.clamp(this.delta_, -maxDelta, maxDelta); var view = map.getView(); - goog.asserts.assert(goog.isDef(view)); + goog.asserts.assert(!goog.isNull(view)); map.render(); ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_, diff --git a/src/ol/map.js b/src/ol/map.js index b013cd4cdd..792f24041b 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -753,7 +753,7 @@ goog.exportProperty( /** * Get the view associated with this map. A view manages properties such as * center and resolution. - * @return {ol.View|undefined} The view that controls this map. + * @return {ol.View} The view that controls this map. * @observable * @api stable */ @@ -988,7 +988,7 @@ ol.Map.prototype.handleViewChanged_ = function() { this.viewPropertyListenerKey_ = null; } var view = this.getView(); - if (goog.isDefAndNotNull(view)) { + if (!goog.isNull(view)) { this.viewPropertyListenerKey_ = goog.events.listen( view, ol.ObjectEventType.PROPERTYCHANGE, this.handleViewPropertyChanged_, false, this); @@ -1061,7 +1061,7 @@ ol.Map.prototype.isDef = function() { return false; } var view = this.getView(); - if (!goog.isDef(view) || !view.isDef()) { + if (goog.isNull(view) || !view.isDef()) { return false; } return true; @@ -1189,7 +1189,7 @@ ol.Map.prototype.renderFrame_ = function(time) { /** @type {?olx.FrameState} */ var frameState = null; if (goog.isDef(size) && hasArea(size) && - goog.isDef(view) && view.isDef()) { + !goog.isNull(view) && view.isDef()) { var viewHints = view.getHints(); var layerStatesArray = this.getLayerGroup().getLayerStatesArray(); var layerStates = {};