Replace !goog.isDefAndNotNull() with falsey checks
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user