Inline various goog.isDef() calls
This commit is contained in:
@@ -346,7 +346,7 @@ ol.Graticule.prototype.getMeridian_ = function(lon, minLat, maxLat,
|
||||
minLat, maxLat, this.projection_, squaredTolerance);
|
||||
goog.asserts.assert(flatCoordinates.length > 0,
|
||||
'flatCoordinates cannot be empty');
|
||||
var lineString = goog.isDef(this.meridians_[index]) ?
|
||||
var lineString = this.meridians_[index] !== undefined ?
|
||||
this.meridians_[index] : new ol.geom.LineString(null);
|
||||
lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates);
|
||||
return lineString;
|
||||
@@ -382,7 +382,7 @@ ol.Graticule.prototype.getParallel_ = function(lat, minLon, maxLon,
|
||||
this.minLon_, this.maxLon_, this.projection_, squaredTolerance);
|
||||
goog.asserts.assert(flatCoordinates.length > 0,
|
||||
'flatCoordinates cannot be empty');
|
||||
var lineString = goog.isDef(this.parallels_[index]) ?
|
||||
var lineString = this.parallels_[index] !== undefined ?
|
||||
this.parallels_[index] : new ol.geom.LineString(null);
|
||||
lineString.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates);
|
||||
return lineString;
|
||||
|
||||
@@ -126,7 +126,7 @@ ol.ImageTile.prototype.handleImageError_ = function() {
|
||||
*/
|
||||
ol.ImageTile.prototype.handleImageLoad_ = function() {
|
||||
if (ol.LEGACY_IE_SUPPORT && ol.IS_LEGACY_IE) {
|
||||
if (!goog.isDef(this.image_.naturalWidth)) {
|
||||
if (this.image_.naturalWidth === undefined) {
|
||||
this.image_.naturalWidth = this.image_.width;
|
||||
this.image_.naturalHeight = this.image_.height;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ ol.proj.Projection = function(options) {
|
||||
goog.asserts.assert(code !== undefined,
|
||||
'Option "code" is required for constructing instance');
|
||||
if (ol.ENABLE_PROJ4JS && typeof proj4 == 'function' &&
|
||||
!goog.isDef(projections[code])) {
|
||||
projections[code] === undefined) {
|
||||
var def = proj4.defs(code);
|
||||
if (def !== undefined) {
|
||||
if (def.axis !== undefined && options.axisOrientation === undefined) {
|
||||
|
||||
@@ -257,11 +257,12 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
||||
case ol.render.canvas.Instruction.BEGIN_GEOMETRY:
|
||||
feature = /** @type {ol.Feature} */ (instruction[1]);
|
||||
var featureUid = goog.getUid(feature).toString();
|
||||
if (goog.isDef(skippedFeaturesHash[featureUid]) ||
|
||||
if (skippedFeaturesHash[featureUid] !== undefined ||
|
||||
!goog.isDefAndNotNull(feature.getGeometry())) {
|
||||
i = /** @type {number} */ (instruction[2]);
|
||||
} else if (opt_hitExtent !== undefined && !ol.extent.intersects(
|
||||
opt_hitExtent, feature.getGeometry().getExtent())) {
|
||||
/** @type {Array<number>} */ (opt_hitExtent),
|
||||
feature.getGeometry().getExtent())) {
|
||||
i = /** @type {number} */ (instruction[2]);
|
||||
} else {
|
||||
++i;
|
||||
@@ -451,7 +452,8 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
||||
'6th instruction should be a number');
|
||||
goog.asserts.assert(!goog.isNull(instruction[6]),
|
||||
'7th instruction should not be null');
|
||||
var usePixelRatio = goog.isDef(instruction[7]) ? instruction[7] : true;
|
||||
var usePixelRatio = instruction[7] !== undefined ?
|
||||
instruction[7] : true;
|
||||
var lineWidth = /** @type {number} */ (instruction[2]);
|
||||
context.strokeStyle = /** @type {string} */ (instruction[1]);
|
||||
context.lineWidth = usePixelRatio ? lineWidth * pixelRatio : lineWidth;
|
||||
|
||||
@@ -733,7 +733,7 @@ ol.render.webgl.ImageReplay.prototype.drawReplaySkipping_ =
|
||||
var feature = this.startIndicesFeature_[featureIndex];
|
||||
|
||||
var featureUid = goog.getUid(feature).toString();
|
||||
if (goog.isDef(skippedFeaturesHash[featureUid])) {
|
||||
if (skippedFeaturesHash[featureUid] !== undefined) {
|
||||
// feature should be skipped
|
||||
if (start !== end) {
|
||||
// draw the features so far
|
||||
@@ -865,10 +865,11 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne_ =
|
||||
feature = this.startIndicesFeature_[featureIndex];
|
||||
featureUid = goog.getUid(feature).toString();
|
||||
|
||||
if (!goog.isDef(skippedFeaturesHash[featureUid]) &&
|
||||
if (skippedFeaturesHash[featureUid] === undefined &&
|
||||
goog.isDefAndNotNull(feature.getGeometry()) &&
|
||||
(opt_hitExtent === undefined || ol.extent.intersects(
|
||||
opt_hitExtent, feature.getGeometry().getExtent()))) {
|
||||
/** @type {Array<number>} */ (opt_hitExtent),
|
||||
feature.getGeometry().getExtent()))) {
|
||||
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
||||
this.drawElements_(gl, start, end, elementType, elementSize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user