diff --git a/src/ol/image.js b/src/ol/image.js index d98229bc43..8f4245b004 100644 --- a/src/ol/image.js +++ b/src/ol/image.js @@ -114,7 +114,7 @@ ol.Image.prototype.handleImageError_ = function() { * @private */ ol.Image.prototype.handleImageLoad_ = function() { - if (!goog.isDef(this.resolution)) { + if (this.resolution === undefined) { this.resolution = ol.extent.getHeight(this.extent) / this.image_.height; } this.state = ol.ImageState.LOADED; diff --git a/src/ol/proj/proj.js b/src/ol/proj/proj.js index 2109dbc766..821b133e8d 100644 --- a/src/ol/proj/proj.js +++ b/src/ol/proj/proj.js @@ -152,7 +152,7 @@ ol.proj.Projection = function(options) { if (goog.isDef(def.axis) && !goog.isDef(options.axisOrientation)) { this.axisOrientation_ = def.axis; } - if (!goog.isDef(options.units)) { + if (options.units === undefined) { var units = def.units; if (units === undefined) { if (def.to_meter !== undefined) { diff --git a/src/ol/source/clustersource.js b/src/ol/source/clustersource.js index b0aaf7f15e..d1e15c01c3 100644 --- a/src/ol/source/clustersource.js +++ b/src/ol/source/clustersource.js @@ -103,7 +103,7 @@ ol.source.Cluster.prototype.onSourceChange_ = function() { * @private */ ol.source.Cluster.prototype.cluster_ = function() { - if (!goog.isDef(this.resolution_)) { + if (this.resolution_ === undefined) { return; } this.features_.length = 0; diff --git a/src/ol/source/imagewmssource.js b/src/ol/source/imagewmssource.js index ec126ecbd6..06e36fcb85 100644 --- a/src/ol/source/imagewmssource.js +++ b/src/ol/source/imagewmssource.js @@ -142,7 +142,7 @@ ol.source.ImageWMS.prototype.getGetFeatureInfoUrl = goog.asserts.assert(!('VERSION' in params), 'key VERSION is not allowed in params'); - if (!goog.isDef(this.url_)) { + if (this.url_ === undefined) { return undefined; } @@ -188,7 +188,7 @@ ol.source.ImageWMS.prototype.getParams = function() { ol.source.ImageWMS.prototype.getImage = function(extent, resolution, pixelRatio, projection) { - if (!goog.isDef(this.url_)) { + if (this.url_ === undefined) { return null; } diff --git a/src/ol/style/fillstyle.js b/src/ol/style/fillstyle.js index 74f5162b62..19895f0c86 100644 --- a/src/ol/style/fillstyle.js +++ b/src/ol/style/fillstyle.js @@ -58,7 +58,7 @@ ol.style.Fill.prototype.setColor = function(color) { * @inheritDoc */ ol.style.Fill.prototype.getChecksum = function() { - if (!goog.isDef(this.checksum_)) { + if (this.checksum_ === undefined) { this.checksum_ = 'f' + (!goog.isNull(this.color_) ? ol.color.asString(this.color_) : '-'); } diff --git a/src/ol/style/strokestyle.js b/src/ol/style/strokestyle.js index e5599ab044..1fbd7a9a02 100644 --- a/src/ol/style/strokestyle.js +++ b/src/ol/style/strokestyle.js @@ -203,7 +203,7 @@ ol.style.Stroke.prototype.setWidth = function(width) { * @inheritDoc */ ol.style.Stroke.prototype.getChecksum = function() { - if (!goog.isDef(this.checksum_)) { + if (this.checksum_ === undefined) { var raw = 's' + (!goog.isNull(this.color_) ? ol.color.asString(this.color_) : '-') + ',' + diff --git a/src/ol/tilegrid/tilegrid.js b/src/ol/tilegrid/tilegrid.js index 5cf1a4b15b..7efb55ea90 100644 --- a/src/ol/tilegrid/tilegrid.js +++ b/src/ol/tilegrid/tilegrid.js @@ -552,7 +552,7 @@ ol.tilegrid.createXYZ = function(opt_options) { var options = /** @type {olx.tilegrid.TileGridOptions} */ ({}); goog.object.extend(options, goog.isDef(opt_options) ? opt_options : /** @type {olx.tilegrid.XYZOptions} */ ({})); - if (!goog.isDef(options.extent)) { + if (options.extent === undefined) { options.extent = ol.proj.get('EPSG:3857').getExtent(); } options.resolutions = ol.tilegrid.resolutionsFromExtent( diff --git a/test/spec/ol/extent.test.js b/test/spec/ol/extent.test.js index b1e8578ceb..1c0235a69c 100644 --- a/test/spec/ol/extent.test.js +++ b/test/spec/ol/extent.test.js @@ -837,7 +837,7 @@ describe('ol.extent', function() { it('takes arbitrary function', function() { var transformFn = function(input, output, opt_dimension) { var dimension = goog.isDef(opt_dimension) ? opt_dimension : 2; - if (!goog.isDef(output)) { + if (output === undefined) { output = new Array(input.length); } var n = input.length;