Unify return statement
Only return the callback result if it is truthy, otherwise return undefined.
This commit is contained in:
@@ -764,7 +764,13 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayAll_ =
|
|||||||
gl.drawElements(goog.webgl.TRIANGLES, numItems, elementType, offsetInBytes);
|
gl.drawElements(goog.webgl.TRIANGLES, numItems, elementType, offsetInBytes);
|
||||||
start = end;
|
start = end;
|
||||||
}
|
}
|
||||||
return featureCallback(null);
|
|
||||||
|
var result = featureCallback(null);
|
||||||
|
if (result) {
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1160,7 +1166,7 @@ ol.render.webgl.ReplayGroup.prototype.hasFeatureAtPixel = function(
|
|||||||
return imageData[3] > 0;
|
return imageData[3] > 0;
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
return goog.isDef(hasFeature) ? hasFeature : false;
|
return goog.isDef(hasFeature);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ ol.renderer.Map.prototype.hasFeatureAtPixel =
|
|||||||
var hasFeature = this.forEachFeatureAtPixel(
|
var hasFeature = this.forEachFeatureAtPixel(
|
||||||
coordinate, frameState, goog.functions.TRUE, this, layerFilter, thisArg);
|
coordinate, frameState, goog.functions.TRUE, this, layerFilter, thisArg);
|
||||||
|
|
||||||
return goog.isDef(hasFeature) ? hasFeature : false;
|
return goog.isDef(hasFeature);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user