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