diff --git a/src/ol/geom/flat/flipflatgeom.js b/src/ol/geom/flat/flipflatgeom.js index fbf6bd7c72..8532682e46 100644 --- a/src/ol/geom/flat/flipflatgeom.js +++ b/src/ol/geom/flat/flipflatgeom.js @@ -19,7 +19,7 @@ ol.geom.flat.flip.flipXY = dest = opt_dest; destOffset = goog.isDef(opt_destOffset) ? opt_destOffset : 0; } else { - goog.asserts.assert(!goog.isDef(opt_destOffset), + goog.asserts.assert(opt_destOffset === undefined, 'opt_destOffSet should be defined'); dest = []; destOffset = 0; diff --git a/src/ol/overlay.js b/src/ol/overlay.js index c9bda6cb0b..71b3f649d8 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -366,7 +366,7 @@ ol.Overlay.prototype.panIntoView_ = function() { goog.asserts.assert(this.autoPan, 'this.autoPan should be true'); var map = this.getMap(); - if (!goog.isDef(map) || goog.isNull(map.getTargetElement())) { + if (map === undefined || goog.isNull(map.getTargetElement())) { return; } @@ -474,7 +474,7 @@ ol.Overlay.prototype.setVisible = function(visible) { ol.Overlay.prototype.updatePixelPosition = function() { var map = this.getMap(); var position = this.getPosition(); - if (!goog.isDef(map) || !map.isRendered() || !goog.isDef(position)) { + if (map === undefined || !map.isRendered() || position === undefined) { this.setVisible(false); return; } diff --git a/src/ol/proj/proj.js b/src/ol/proj/proj.js index 821b133e8d..27d0f42873 100644 --- a/src/ol/proj/proj.js +++ b/src/ol/proj/proj.js @@ -652,7 +652,7 @@ ol.proj.get = function(projectionLike) { } else if (goog.isString(projectionLike)) { var code = projectionLike; projection = ol.proj.projections_[code]; - if (ol.ENABLE_PROJ4JS && !goog.isDef(projection) && + if (ol.ENABLE_PROJ4JS && projection === undefined && typeof proj4 == 'function' && goog.isDef(proj4.defs(code))) { projection = new ol.proj.Projection({code: code}); ol.proj.addProjection(projection); diff --git a/src/ol/render/canvas/canvasreplay.js b/src/ol/render/canvas/canvasreplay.js index 96a96951cb..8de2dbecb3 100644 --- a/src/ol/render/canvas/canvasreplay.js +++ b/src/ol/render/canvas/canvasreplay.js @@ -1007,7 +1007,7 @@ ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry = goog.asserts.assert(!goog.isNull(state), 'state should not be null'); var strokeStyle = state.strokeStyle; var lineWidth = state.lineWidth; - if (!goog.isDef(strokeStyle) || !goog.isDef(lineWidth)) { + if (strokeStyle === undefined || lineWidth === undefined) { return; } this.setStrokeStyle_(); @@ -1035,7 +1035,7 @@ ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry = goog.asserts.assert(!goog.isNull(state), 'state should not be null'); var strokeStyle = state.strokeStyle; var lineWidth = state.lineWidth; - if (!goog.isDef(strokeStyle) || !goog.isDef(lineWidth)) { + if (strokeStyle === undefined || lineWidth === undefined) { return; } this.setStrokeStyle_(); @@ -1217,7 +1217,7 @@ ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry = goog.asserts.assert(!goog.isNull(state), 'state should not be null'); var fillStyle = state.fillStyle; var strokeStyle = state.strokeStyle; - if (!goog.isDef(fillStyle) && !goog.isDef(strokeStyle)) { + if (fillStyle === undefined && strokeStyle === undefined) { return; } if (strokeStyle !== undefined) { @@ -1270,7 +1270,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry = goog.asserts.assert(!goog.isNull(state), 'state should not be null'); var fillStyle = state.fillStyle; var strokeStyle = state.strokeStyle; - if (!goog.isDef(fillStyle) && !goog.isDef(strokeStyle)) { + if (fillStyle === undefined && strokeStyle === undefined) { return; } if (strokeStyle !== undefined) { @@ -1306,7 +1306,7 @@ ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry = goog.asserts.assert(!goog.isNull(state), 'state should not be null'); var fillStyle = state.fillStyle; var strokeStyle = state.strokeStyle; - if (!goog.isDef(fillStyle) && !goog.isDef(strokeStyle)) { + if (fillStyle === undefined && strokeStyle === undefined) { return; } if (strokeStyle !== undefined) { diff --git a/src/ol/render/webgl/webglreplay.js b/src/ol/render/webgl/webglreplay.js index 122cafb759..9508c34470 100644 --- a/src/ol/render/webgl/webglreplay.js +++ b/src/ol/render/webgl/webglreplay.js @@ -866,7 +866,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne_ = if (!goog.isDef(skippedFeaturesHash[featureUid]) && goog.isDefAndNotNull(feature.getGeometry()) && - (!goog.isDef(opt_hitExtent) || ol.extent.intersects( + (opt_hitExtent === undefined || ol.extent.intersects( opt_hitExtent, feature.getGeometry().getExtent()))) { gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); this.drawElements_(gl, start, end, elementType, elementSize); diff --git a/src/ol/source/tilearcgisrestsource.js b/src/ol/source/tilearcgisrestsource.js index 8ec3c9e74c..e1093f1006 100644 --- a/src/ol/source/tilearcgisrestsource.js +++ b/src/ol/source/tilearcgisrestsource.js @@ -48,7 +48,7 @@ ol.source.TileArcGISRest = function(opt_options) { }); var urls = options.urls; - if (!goog.isDef(urls) && goog.isDef(options.url)) { + if (urls === undefined && goog.isDef(options.url)) { urls = ol.TileUrlFunction.expandUrl(options.url); } diff --git a/src/ol/source/tilewmssource.js b/src/ol/source/tilewmssource.js index 8a17db97da..12f8eff1d3 100644 --- a/src/ol/source/tilewmssource.js +++ b/src/ol/source/tilewmssource.js @@ -52,7 +52,7 @@ ol.source.TileWMS = function(opt_options) { }); var urls = options.urls; - if (!goog.isDef(urls) && goog.isDef(options.url)) { + if (urls === undefined && goog.isDef(options.url)) { urls = ol.TileUrlFunction.expandUrl(options.url); } diff --git a/src/ol/source/vectorsource.js b/src/ol/source/vectorsource.js index 074154a968..bf698e6ea0 100644 --- a/src/ol/source/vectorsource.js +++ b/src/ol/source/vectorsource.js @@ -161,7 +161,7 @@ ol.source.Vector = function(opt_options) { } else if (goog.isArray(options.features)) { features = options.features; } - if (!useSpatialIndex && !goog.isDef(collection)) { + if (!useSpatialIndex && collection === undefined) { collection = new ol.Collection(features); } if (features !== undefined) { diff --git a/src/ol/source/wmtssource.js b/src/ol/source/wmtssource.js index 616c82d843..698a003576 100644 --- a/src/ol/source/wmtssource.js +++ b/src/ol/source/wmtssource.js @@ -83,7 +83,7 @@ ol.source.WMTS = function(options) { this.style_ = options.style; var urls = options.urls; - if (!goog.isDef(urls) && goog.isDef(options.url)) { + if (urls === undefined && goog.isDef(options.url)) { urls = ol.TileUrlFunction.expandUrl(options.url); } diff --git a/src/ol/style/iconstyle.js b/src/ol/style/iconstyle.js index 87d13574a2..edbb76b90c 100644 --- a/src/ol/style/iconstyle.js +++ b/src/ol/style/iconstyle.js @@ -108,13 +108,13 @@ ol.style.Icon = function(opt_options) { goog.asserts.assert(!(goog.isDef(src) && !goog.isNull(image)), 'image and src can not provided at the same time'); goog.asserts.assert( - !goog.isDef(src) || (goog.isDef(src) && goog.isNull(imgSize)), + src === undefined || (goog.isDef(src) && goog.isNull(imgSize)), 'imgSize should not be set when src is provided'); goog.asserts.assert( goog.isNull(image) || (!goog.isNull(image) && !goog.isNull(imgSize)), 'imgSize must be set when image is provided'); - if ((!goog.isDef(src) || src.length === 0) && !goog.isNull(image)) { + if ((src === undefined || src.length === 0) && !goog.isNull(image)) { src = image.src; } goog.asserts.assert(goog.isDef(src) && src.length > 0, diff --git a/src/ol/view.js b/src/ol/view.js index fb2092c2b7..059d0da86a 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -738,7 +738,7 @@ ol.View.createRotationConstraint_ = function(options) { options.enableRotation : true; if (enableRotation) { var constrainRotation = options.constrainRotation; - if (!goog.isDef(constrainRotation) || constrainRotation === true) { + if (constrainRotation === undefined || constrainRotation === true) { return ol.RotationConstraint.createSnapToZero(); } else if (constrainRotation === false) { return ol.RotationConstraint.none;