Replace !goog.isDefAndNotNull() with falsey checks

This commit is contained in:
Tim Schaub
2015-09-27 11:42:49 -06:00
parent ac7db89a91
commit ed3dcd636f
9 changed files with 9 additions and 9 deletions

View File

@@ -84,7 +84,7 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success) {
if (!goog.userAgent.IE) {
source = xhrIo.getResponseXml();
}
if (!goog.isDefAndNotNull(source)) {
if (!source) {
source = ol.xml.parse(xhrIo.getResponseText());
}
} else {

View File

@@ -484,7 +484,7 @@ ol.proj.clearAllProjections = function() {
* @return {ol.proj.Projection} Projection.
*/
ol.proj.createProjection = function(projection, defaultCode) {
if (!goog.isDefAndNotNull(projection)) {
if (!projection) {
return ol.proj.get(defaultCode);
} else if (goog.isString(projection)) {
return ol.proj.get(projection);

View File

@@ -121,7 +121,7 @@ ol.renderer.vector.renderFeature = function(
ol.renderer.vector.renderFeature_ = function(
replayGroup, feature, style, squaredTolerance) {
var geometry = style.getGeometryFunction()(feature);
if (!goog.isDefAndNotNull(geometry)) {
if (!geometry) {
return;
}
var simplifiedGeometry = geometry.getSimplifiedGeometry(squaredTolerance);

View File

@@ -328,7 +328,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
*/
ol.renderer.canvas.VectorLayer.prototype.renderFeature =
function(feature, resolution, pixelRatio, styles, replayGroup) {
if (!goog.isDefAndNotNull(styles)) {
if (!styles) {
return false;
}
var i, ii, loading = false;

View File

@@ -336,7 +336,7 @@ ol.renderer.dom.VectorLayer.prototype.prepareFrame =
*/
ol.renderer.dom.VectorLayer.prototype.renderFeature =
function(feature, resolution, pixelRatio, styles, replayGroup) {
if (!goog.isDefAndNotNull(styles)) {
if (!styles) {
return false;
}
var i, ii, loading = false;

View File

@@ -304,7 +304,7 @@ ol.renderer.webgl.VectorLayer.prototype.prepareFrame =
*/
ol.renderer.webgl.VectorLayer.prototype.renderFeature =
function(feature, resolution, pixelRatio, styles, replayGroup) {
if (!goog.isDefAndNotNull(styles)) {
if (!styles) {
return false;
}
var i, ii, loading = false;

View File

@@ -265,7 +265,7 @@ ol.source.ImageVector.prototype.renderFeature_ =
} else if (this.styleFunction_) {
styles = this.styleFunction_(feature, resolution);
}
if (!goog.isDefAndNotNull(styles)) {
if (!styles) {
return false;
}
var i, ii, loading = false;

View File

@@ -131,7 +131,7 @@ ol.source.TileUTFGrid.prototype.handleTileJSONResponse = function(tileJSON) {
this.template_ = tileJSON.template;
var grids = tileJSON.grids;
if (!goog.isDefAndNotNull(grids)) {
if (!grids) {
this.setState(ol.source.State.ERROR);
return;
}

View File

@@ -705,7 +705,7 @@ ol.source.Vector.prototype.handleFeatureChange_ = function(event) {
var feature = /** @type {ol.Feature} */ (event.target);
var featureKey = goog.getUid(feature).toString();
var geometry = feature.getGeometry();
if (!goog.isDefAndNotNull(geometry)) {
if (!geometry) {
if (!(featureKey in this.nullGeometryFeatures_)) {
if (!goog.isNull(this.featuresRtree_)) {
this.featuresRtree_.remove(feature);