Inline goog.isDef() calls for properties

This commit is contained in:
Tim Schaub
2015-09-27 10:40:20 -06:00
parent 36e336f406
commit 83c59ee255
44 changed files with 200 additions and 198 deletions

View File

@@ -97,7 +97,7 @@ ol.Geolocation = function(opt_options) {
this.setTrackingOptions(options.trackingOptions); this.setTrackingOptions(options.trackingOptions);
} }
this.setTracking(goog.isDef(options.tracking) ? options.tracking : false); this.setTracking(options.tracking !== undefined ? options.tracking : false);
}; };
goog.inherits(ol.Geolocation, ol.Object); goog.inherits(ol.Geolocation, ol.Object);
@@ -139,7 +139,7 @@ ol.Geolocation.prototype.handleTrackingChanged_ = function() {
goog.bind(this.positionChange_, this), goog.bind(this.positionChange_, this),
goog.bind(this.positionError_, this), goog.bind(this.positionError_, this),
this.getTrackingOptions()); this.getTrackingOptions());
} else if (!tracking && goog.isDef(this.watchId_)) { } else if (!tracking && this.watchId_ !== undefined) {
goog.global.navigator.geolocation.clearWatch(this.watchId_); goog.global.navigator.geolocation.clearWatch(this.watchId_);
this.watchId_ = undefined; this.watchId_ = undefined;
} }

View File

@@ -86,14 +86,14 @@ ol.Graticule = function(opt_options) {
* @type {number} * @type {number}
* @private * @private
*/ */
this.targetSize_ = goog.isDef(options.targetSize) ? this.targetSize_ = options.targetSize !== undefined ?
options.targetSize : 100; options.targetSize : 100;
/** /**
* @type {number} * @type {number}
* @private * @private
*/ */
this.maxLines_ = goog.isDef(options.maxLines) ? options.maxLines : 100; this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
goog.asserts.assert(this.maxLines_ > 0, goog.asserts.assert(this.maxLines_ > 0,
'this.maxLines_ should be more than 0'); 'this.maxLines_ should be more than 0');
@@ -113,7 +113,7 @@ ol.Graticule = function(opt_options) {
* @type {ol.style.Stroke} * @type {ol.style.Stroke}
* @private * @private
*/ */
this.strokeStyle_ = goog.isDef(options.strokeStyle) ? this.strokeStyle_ = options.strokeStyle !== undefined ?
options.strokeStyle : ol.Graticule.DEFAULT_STROKE_STYLE_; options.strokeStyle : ol.Graticule.DEFAULT_STROKE_STYLE_;
/** /**
@@ -134,7 +134,7 @@ ol.Graticule = function(opt_options) {
*/ */
this.projectionCenterLonLat_ = null; this.projectionCenterLonLat_ = null;
this.setMap(goog.isDef(options.map) ? options.map : null); this.setMap(options.map !== undefined ? options.map : null);
}; };

View File

@@ -110,7 +110,7 @@ ol.ImageBase.prototype.getPixelRatio = function() {
* @return {number} Resolution. * @return {number} Resolution.
*/ */
ol.ImageBase.prototype.getResolution = function() { ol.ImageBase.prototype.getResolution = function() {
goog.asserts.assert(goog.isDef(this.resolution), 'resolution not yet set'); goog.asserts.assert(this.resolution !== undefined, 'resolution not yet set');
return this.resolution; return this.resolution;
}; };

View File

@@ -42,7 +42,7 @@ ol.interaction.Translate = function(options) {
* @type {ol.Collection.<ol.Feature>} * @type {ol.Collection.<ol.Feature>}
* @private * @private
*/ */
this.features_ = goog.isDef(options.features) ? options.features : null; this.features_ = options.features !== undefined ? options.features : null;
/** /**
* @type {ol.Feature} * @type {ol.Feature}
@@ -147,7 +147,7 @@ ol.interaction.Translate.handleMoveEvent_ = function(event)
'grabbing' : (isSelected ? 'grab' : 'pointer'); 'grabbing' : (isSelected ? 'grab' : 'pointer');
} else { } else {
elem.style.cursor = goog.isDef(this.previousCursor_) ? elem.style.cursor = this.previousCursor_ !== undefined ?
this.previousCursor_ : ''; this.previousCursor_ : '';
this.previousCursor_ = undefined; this.previousCursor_ = undefined;
} }

View File

@@ -181,22 +181,23 @@ ol.Map = function(options) {
* @type {boolean} * @type {boolean}
* @private * @private
*/ */
this.loadTilesWhileAnimating_ = goog.isDef(options.loadTilesWhileAnimating) ? this.loadTilesWhileAnimating_ =
options.loadTilesWhileAnimating : false; options.loadTilesWhileAnimating !== undefined ?
options.loadTilesWhileAnimating : false;
/** /**
* @type {boolean} * @type {boolean}
* @private * @private
*/ */
this.loadTilesWhileInteracting_ = this.loadTilesWhileInteracting_ =
goog.isDef(options.loadTilesWhileInteracting) ? options.loadTilesWhileInteracting !== undefined ?
options.loadTilesWhileInteracting : false; options.loadTilesWhileInteracting : false;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.pixelRatio_ = goog.isDef(options.pixelRatio) ? this.pixelRatio_ = options.pixelRatio !== undefined ?
options.pixelRatio : ol.has.DEVICE_PIXEL_RATIO; options.pixelRatio : ol.has.DEVICE_PIXEL_RATIO;
/** /**
@@ -1486,7 +1487,7 @@ ol.Map.createOptionsInternal = function(options) {
values[ol.MapProperty.TARGET] = options.target; values[ol.MapProperty.TARGET] = options.target;
values[ol.MapProperty.VIEW] = goog.isDef(options.view) ? values[ol.MapProperty.VIEW] = options.view !== undefined ?
options.view : new ol.View(); options.view : new ol.View();
/** /**

View File

@@ -78,14 +78,14 @@ ol.Overlay = function(options) {
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.insertFirst_ = goog.isDef(options.insertFirst) ? this.insertFirst_ = options.insertFirst !== undefined ?
options.insertFirst : true; options.insertFirst : true;
/** /**
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.stopEvent_ = goog.isDef(options.stopEvent) ? options.stopEvent : true; this.stopEvent_ = options.stopEvent !== undefined ? options.stopEvent : true;
/** /**
* @private * @private
@@ -100,20 +100,20 @@ ol.Overlay = function(options) {
* @protected * @protected
* @type {boolean} * @type {boolean}
*/ */
this.autoPan = goog.isDef(options.autoPan) ? options.autoPan : false; this.autoPan = options.autoPan !== undefined ? options.autoPan : false;
/** /**
* @private * @private
* @type {olx.animation.PanOptions} * @type {olx.animation.PanOptions}
*/ */
this.autoPanAnimation_ = goog.isDef(options.autoPanAnimation) ? this.autoPanAnimation_ = options.autoPanAnimation !== undefined ?
options.autoPanAnimation : /** @type {olx.animation.PanOptions} */ ({}); options.autoPanAnimation : /** @type {olx.animation.PanOptions} */ ({});
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.autoPanMargin_ = goog.isDef(options.autoPanMargin) ? this.autoPanMargin_ = options.autoPanMargin !== undefined ?
options.autoPanMargin : 20; options.autoPanMargin : 20;
/** /**
@@ -162,9 +162,9 @@ ol.Overlay = function(options) {
this.setElement(options.element); this.setElement(options.element);
} }
this.setOffset(goog.isDef(options.offset) ? options.offset : [0, 0]); this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);
this.setPositioning(goog.isDef(options.positioning) ? this.setPositioning(options.positioning !== undefined ?
/** @type {ol.OverlayPositioning} */ (options.positioning) : /** @type {ol.OverlayPositioning} */ (options.positioning) :
ol.OverlayPositioning.TOP_LEFT); ol.OverlayPositioning.TOP_LEFT);

View File

@@ -99,27 +99,27 @@ ol.proj.Projection = function(options) {
* @private * @private
* @type {ol.Extent} * @type {ol.Extent}
*/ */
this.extent_ = goog.isDef(options.extent) ? options.extent : null; this.extent_ = options.extent !== undefined ? options.extent : null;
/** /**
* @private * @private
* @type {ol.Extent} * @type {ol.Extent}
*/ */
this.worldExtent_ = goog.isDef(options.worldExtent) ? this.worldExtent_ = options.worldExtent !== undefined ?
options.worldExtent : null; options.worldExtent : null;
/** /**
* @private * @private
* @type {string} * @type {string}
*/ */
this.axisOrientation_ = goog.isDef(options.axisOrientation) ? this.axisOrientation_ = options.axisOrientation !== undefined ?
options.axisOrientation : 'enu'; options.axisOrientation : 'enu';
/** /**
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.global_ = goog.isDef(options.global) ? options.global : false; this.global_ = options.global !== undefined ? options.global : false;
/** /**
@@ -132,7 +132,7 @@ ol.proj.Projection = function(options) {
* @private * @private
* @type {function(number, ol.Coordinate):number} * @type {function(number, ol.Coordinate):number}
*/ */
this.getPointResolutionFunc_ = goog.isDef(options.getPointResolution) ? this.getPointResolutionFunc_ = options.getPointResolution !== undefined ?
options.getPointResolution : this.getPointResolution_; options.getPointResolution : this.getPointResolution_;
/** /**
@@ -149,7 +149,7 @@ ol.proj.Projection = function(options) {
!goog.isDef(projections[code])) { !goog.isDef(projections[code])) {
var def = proj4.defs(code); var def = proj4.defs(code);
if (def !== undefined) { if (def !== undefined) {
if (goog.isDef(def.axis) && options.axisOrientation === undefined) { if (def.axis !== undefined && options.axisOrientation === undefined) {
this.axisOrientation_ = def.axis; this.axisOrientation_ = def.axis;
} }
if (options.units === undefined) { if (options.units === undefined) {

View File

@@ -716,25 +716,25 @@ ol.render.canvas.ImageReplay.prototype.drawPointGeometry =
if (goog.isNull(this.image_)) { if (goog.isNull(this.image_)) {
return; return;
} }
goog.asserts.assert(goog.isDef(this.anchorX_), goog.asserts.assert(this.anchorX_ !== undefined,
'this.anchorX_ should be defined'); 'this.anchorX_ should be defined');
goog.asserts.assert(goog.isDef(this.anchorY_), goog.asserts.assert(this.anchorY_ !== undefined,
'this.anchorY_ should be defined'); 'this.anchorY_ should be defined');
goog.asserts.assert(goog.isDef(this.height_), goog.asserts.assert(this.height_ !== undefined,
'this.height_ should be defined'); 'this.height_ should be defined');
goog.asserts.assert(goog.isDef(this.opacity_), goog.asserts.assert(this.opacity_ !== undefined,
'this.opacity_ should be defined'); 'this.opacity_ should be defined');
goog.asserts.assert(goog.isDef(this.originX_), goog.asserts.assert(this.originX_ !== undefined,
'this.originX_ should be defined'); 'this.originX_ should be defined');
goog.asserts.assert(goog.isDef(this.originY_), goog.asserts.assert(this.originY_ !== undefined,
'this.originY_ should be defined'); 'this.originY_ should be defined');
goog.asserts.assert(goog.isDef(this.rotateWithView_), goog.asserts.assert(this.rotateWithView_ !== undefined,
'this.rotateWithView_ should be defined'); 'this.rotateWithView_ should be defined');
goog.asserts.assert(goog.isDef(this.rotation_), goog.asserts.assert(this.rotation_ !== undefined,
'this.rotation_ should be defined'); 'this.rotation_ should be defined');
goog.asserts.assert(goog.isDef(this.scale_), goog.asserts.assert(this.scale_ !== undefined,
'this.scale_ should be defined'); 'this.scale_ should be defined');
goog.asserts.assert(goog.isDef(this.width_), goog.asserts.assert(this.width_ !== undefined,
'this.width_ should be defined'); 'this.width_ should be defined');
this.beginGeometry(pointGeometry, feature); this.beginGeometry(pointGeometry, feature);
var flatCoordinates = pointGeometry.getFlatCoordinates(); var flatCoordinates = pointGeometry.getFlatCoordinates();
@@ -769,25 +769,25 @@ ol.render.canvas.ImageReplay.prototype.drawMultiPointGeometry =
if (goog.isNull(this.image_)) { if (goog.isNull(this.image_)) {
return; return;
} }
goog.asserts.assert(goog.isDef(this.anchorX_), goog.asserts.assert(this.anchorX_ !== undefined,
'this.anchorX_ should be defined'); 'this.anchorX_ should be defined');
goog.asserts.assert(goog.isDef(this.anchorY_), goog.asserts.assert(this.anchorY_ !== undefined,
'this.anchorY_ should be defined'); 'this.anchorY_ should be defined');
goog.asserts.assert(goog.isDef(this.height_), goog.asserts.assert(this.height_ !== undefined,
'this.height_ should be defined'); 'this.height_ should be defined');
goog.asserts.assert(goog.isDef(this.opacity_), goog.asserts.assert(this.opacity_ !== undefined,
'this.opacity_ should be defined'); 'this.opacity_ should be defined');
goog.asserts.assert(goog.isDef(this.originX_), goog.asserts.assert(this.originX_ !== undefined,
'this.originX_ should be defined'); 'this.originX_ should be defined');
goog.asserts.assert(goog.isDef(this.originY_), goog.asserts.assert(this.originY_ !== undefined,
'this.originY_ should be defined'); 'this.originY_ should be defined');
goog.asserts.assert(goog.isDef(this.rotateWithView_), goog.asserts.assert(this.rotateWithView_ !== undefined,
'this.rotateWithView_ should be defined'); 'this.rotateWithView_ should be defined');
goog.asserts.assert(goog.isDef(this.rotation_), goog.asserts.assert(this.rotation_ !== undefined,
'this.rotation_ should be defined'); 'this.rotation_ should be defined');
goog.asserts.assert(goog.isDef(this.scale_), goog.asserts.assert(this.scale_ !== undefined,
'this.scale_ should be defined'); 'this.scale_ should be defined');
goog.asserts.assert(goog.isDef(this.width_), goog.asserts.assert(this.width_ !== undefined,
'this.width_ should be defined'); 'this.width_ should be defined');
this.beginGeometry(multiPointGeometry, feature); this.beginGeometry(multiPointGeometry, feature);
var flatCoordinates = multiPointGeometry.getFlatCoordinates(); var flatCoordinates = multiPointGeometry.getFlatCoordinates();
@@ -1198,7 +1198,7 @@ ol.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_ =
this.instructions.push(fillInstruction); this.instructions.push(fillInstruction);
} }
if (state.strokeStyle !== undefined) { if (state.strokeStyle !== undefined) {
goog.asserts.assert(goog.isDef(state.lineWidth), goog.asserts.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
var strokeInstruction = [ol.render.canvas.Instruction.STROKE]; var strokeInstruction = [ol.render.canvas.Instruction.STROKE];
this.instructions.push(strokeInstruction); this.instructions.push(strokeInstruction);
@@ -1221,7 +1221,7 @@ ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry =
return; return;
} }
if (strokeStyle !== undefined) { if (strokeStyle !== undefined) {
goog.asserts.assert(goog.isDef(state.lineWidth), goog.asserts.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
} }
this.setFillStrokeStyles_(); this.setFillStrokeStyles_();
@@ -1251,7 +1251,7 @@ ol.render.canvas.PolygonReplay.prototype.drawCircleGeometry =
this.instructions.push(fillInstruction); this.instructions.push(fillInstruction);
} }
if (state.strokeStyle !== undefined) { if (state.strokeStyle !== undefined) {
goog.asserts.assert(goog.isDef(state.lineWidth), goog.asserts.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
var strokeInstruction = [ol.render.canvas.Instruction.STROKE]; var strokeInstruction = [ol.render.canvas.Instruction.STROKE];
this.instructions.push(strokeInstruction); this.instructions.push(strokeInstruction);
@@ -1274,7 +1274,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry =
return; return;
} }
if (strokeStyle !== undefined) { if (strokeStyle !== undefined) {
goog.asserts.assert(goog.isDef(state.lineWidth), goog.asserts.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
} }
this.setFillStrokeStyles_(); this.setFillStrokeStyles_();
@@ -1310,7 +1310,7 @@ ol.render.canvas.PolygonReplay.prototype.drawMultiPolygonGeometry =
return; return;
} }
if (strokeStyle !== undefined) { if (strokeStyle !== undefined) {
goog.asserts.assert(goog.isDef(state.lineWidth), goog.asserts.assert(state.lineWidth !== undefined,
'state.lineWidth should be defined'); 'state.lineWidth should be defined');
} }
this.setFillStrokeStyles_(); this.setFillStrokeStyles_();

View File

@@ -280,19 +280,20 @@ ol.render.webgl.ImageReplay.prototype.drawAsync = goog.abstractMethod;
*/ */
ol.render.webgl.ImageReplay.prototype.drawCoordinates_ = ol.render.webgl.ImageReplay.prototype.drawCoordinates_ =
function(flatCoordinates, offset, end, stride) { function(flatCoordinates, offset, end, stride) {
goog.asserts.assert(goog.isDef(this.anchorX_), 'anchorX is defined'); goog.asserts.assert(this.anchorX_ !== undefined, 'anchorX is defined');
goog.asserts.assert(goog.isDef(this.anchorY_), 'anchorY is defined'); goog.asserts.assert(this.anchorY_ !== undefined, 'anchorY is defined');
goog.asserts.assert(goog.isDef(this.height_), 'height is defined'); goog.asserts.assert(this.height_ !== undefined, 'height is defined');
goog.asserts.assert(goog.isDef(this.imageHeight_), 'imageHeight is defined'); goog.asserts.assert(this.imageHeight_ !== undefined,
goog.asserts.assert(goog.isDef(this.imageWidth_), 'imageWidth is defined'); 'imageHeight is defined');
goog.asserts.assert(goog.isDef(this.opacity_), 'opacity is defined'); goog.asserts.assert(this.imageWidth_ !== undefined, 'imageWidth is defined');
goog.asserts.assert(goog.isDef(this.originX_), 'originX is defined'); goog.asserts.assert(this.opacity_ !== undefined, 'opacity is defined');
goog.asserts.assert(goog.isDef(this.originY_), 'originY is defined'); goog.asserts.assert(this.originX_ !== undefined, 'originX is defined');
goog.asserts.assert(goog.isDef(this.rotateWithView_), goog.asserts.assert(this.originY_ !== undefined, 'originY is defined');
goog.asserts.assert(this.rotateWithView_ !== undefined,
'rotateWithView is defined'); 'rotateWithView is defined');
goog.asserts.assert(goog.isDef(this.rotation_), 'rotation is defined'); goog.asserts.assert(this.rotation_ !== undefined, 'rotation is defined');
goog.asserts.assert(goog.isDef(this.scale_), 'scale is defined'); goog.asserts.assert(this.scale_ !== undefined, 'scale is defined');
goog.asserts.assert(goog.isDef(this.width_), 'width is defined'); goog.asserts.assert(this.width_ !== undefined, 'width is defined');
var anchorX = this.anchorX_; var anchorX = this.anchorX_;
var anchorY = this.anchorY_; var anchorY = this.anchorY_;
var height = this.height_; var height = this.height_;

View File

@@ -32,20 +32,20 @@ ol.source.BingMaps = function(options) {
projection: ol.proj.get('EPSG:3857'), projection: ol.proj.get('EPSG:3857'),
state: ol.source.State.LOADING, state: ol.source.State.LOADING,
tileLoadFunction: options.tileLoadFunction, tileLoadFunction: options.tileLoadFunction,
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true wrapX: options.wrapX !== undefined ? options.wrapX : true
}); });
/** /**
* @private * @private
* @type {string} * @type {string}
*/ */
this.culture_ = goog.isDef(options.culture) ? options.culture : 'en-us'; this.culture_ = options.culture !== undefined ? options.culture : 'en-us';
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.maxZoom_ = goog.isDef(options.maxZoom) ? options.maxZoom : -1; this.maxZoom_ = options.maxZoom !== undefined ? options.maxZoom : -1;
var uri = new goog.Uri( var uri = new goog.Uri(
'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/' + 'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/' +

View File

@@ -42,7 +42,7 @@ ol.source.Cluster = function(options) {
* @type {number} * @type {number}
* @private * @private
*/ */
this.distance_ = goog.isDef(options.distance) ? options.distance : 20; this.distance_ = options.distance !== undefined ? options.distance : 20;
/** /**
* @type {Array.<ol.Feature>} * @type {Array.<ol.Feature>}

View File

@@ -23,7 +23,7 @@ ol.source.ImageCanvas = function(options) {
logo: options.logo, logo: options.logo,
projection: options.projection, projection: options.projection,
resolutions: options.resolutions, resolutions: options.resolutions,
state: goog.isDef(options.state) ? state: options.state !== undefined ?
/** @type {ol.source.State} */ (options.state) : undefined /** @type {ol.source.State} */ (options.state) : undefined
}); });
@@ -49,7 +49,7 @@ ol.source.ImageCanvas = function(options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.ratio_ = goog.isDef(options.ratio) ? this.ratio_ = options.ratio !== undefined ?
options.ratio : 1.5; options.ratio : 1.5;
}; };

View File

@@ -34,20 +34,20 @@ ol.source.ImageMapGuide = function(options) {
* @type {?string} * @type {?string}
*/ */
this.crossOrigin_ = this.crossOrigin_ =
goog.isDef(options.crossOrigin) ? options.crossOrigin : null; options.crossOrigin !== undefined ? options.crossOrigin : null;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.displayDpi_ = goog.isDef(options.displayDpi) ? this.displayDpi_ = options.displayDpi !== undefined ?
options.displayDpi : 96; options.displayDpi : 96;
/** /**
* @private * @private
* @type {Object} * @type {Object}
*/ */
this.params_ = goog.isDef(options.params) ? options.params : {}; this.params_ = options.params !== undefined ? options.params : {};
var imageUrlFunction; var imageUrlFunction;
if (options.url !== undefined) { if (options.url !== undefined) {
@@ -67,33 +67,33 @@ ol.source.ImageMapGuide = function(options) {
* @private * @private
* @type {ol.ImageLoadFunctionType} * @type {ol.ImageLoadFunctionType}
*/ */
this.imageLoadFunction_ = goog.isDef(options.imageLoadFunction) ? this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
/** /**
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true; this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.metersPerUnit_ = goog.isDef(options.metersPerUnit) ? this.metersPerUnit_ = options.metersPerUnit !== undefined ?
options.metersPerUnit : 1; options.metersPerUnit : 1;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.ratio_ = goog.isDef(options.ratio) ? options.ratio : 1; this.ratio_ = options.ratio !== undefined ? options.ratio : 1;
/** /**
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.useOverlay_ = goog.isDef(options.useOverlay) ? this.useOverlay_ = options.useOverlay !== undefined ?
options.useOverlay : false; options.useOverlay : false;
/** /**

View File

@@ -48,7 +48,7 @@ ol.source.Image = function(options) {
* @private * @private
* @type {Array.<number>} * @type {Array.<number>}
*/ */
this.resolutions_ = goog.isDef(options.resolutions) ? this.resolutions_ = options.resolutions !== undefined ?
options.resolutions : null; options.resolutions : null;
goog.asserts.assert(goog.isNull(this.resolutions_) || goog.asserts.assert(goog.isNull(this.resolutions_) ||
goog.array.isSorted(this.resolutions_, goog.array.isSorted(this.resolutions_,

View File

@@ -21,7 +21,7 @@ goog.require('ol.source.Image');
*/ */
ol.source.ImageStatic = function(options) { ol.source.ImageStatic = function(options) {
var attributions = goog.isDef(options.attributions) ? var attributions = options.attributions !== undefined ?
options.attributions : null; options.attributions : null;
var imageExtent = options.imageExtent; var imageExtent = options.imageExtent;
@@ -32,11 +32,11 @@ ol.source.ImageStatic = function(options) {
resolutions = [resolution]; resolutions = [resolution];
} }
var crossOrigin = goog.isDef(options.crossOrigin) ? var crossOrigin = options.crossOrigin !== undefined ?
options.crossOrigin : null; options.crossOrigin : null;
var /** @type {ol.ImageLoadFunctionType} */ imageLoadFunction = var /** @type {ol.ImageLoadFunctionType} */ imageLoadFunction =
goog.isDef(options.imageLoadFunction) ? options.imageLoadFunction !== undefined ?
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
goog.base(this, { goog.base(this, {

View File

@@ -45,7 +45,7 @@ ol.source.ImageWMS = function(opt_options) {
* @type {?string} * @type {?string}
*/ */
this.crossOrigin_ = this.crossOrigin_ =
goog.isDef(options.crossOrigin) ? options.crossOrigin : null; options.crossOrigin !== undefined ? options.crossOrigin : null;
/** /**
* @private * @private
@@ -57,7 +57,7 @@ ol.source.ImageWMS = function(opt_options) {
* @private * @private
* @type {ol.ImageLoadFunctionType} * @type {ol.ImageLoadFunctionType}
*/ */
this.imageLoadFunction_ = goog.isDef(options.imageLoadFunction) ? this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction; options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
/** /**
@@ -84,7 +84,7 @@ ol.source.ImageWMS = function(opt_options) {
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true; this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
/** /**
* @private * @private
@@ -108,7 +108,7 @@ ol.source.ImageWMS = function(opt_options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.ratio_ = goog.isDef(options.ratio) ? options.ratio : 1.5; this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;
}; };
goog.inherits(ol.source.ImageWMS, ol.source.Image); goog.inherits(ol.source.ImageWMS, ol.source.Image);
@@ -281,7 +281,7 @@ ol.source.ImageWMS.prototype.getImageLoadFunction = function() {
ol.source.ImageWMS.prototype.getRequestUrl_ = ol.source.ImageWMS.prototype.getRequestUrl_ =
function(extent, size, pixelRatio, projection, params) { function(extent, size, pixelRatio, projection, params) {
goog.asserts.assert(goog.isDef(this.url_), 'url is defined'); goog.asserts.assert(this.url_ !== undefined, 'url is defined');
params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode(); params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();

View File

@@ -31,7 +31,7 @@ ol.source.MapQuest = function(opt_options) {
*/ */
this.layer_ = options.layer; this.layer_ = options.layer;
var url = goog.isDef(options.url) ? options.url : var url = options.url !== undefined ? options.url :
'https://otile{1-4}-s.mqcdn.com/tiles/1.0.0/' + 'https://otile{1-4}-s.mqcdn.com/tiles/1.0.0/' +
this.layer_ + '/{z}/{x}/{y}.jpg'; this.layer_ + '/{z}/{x}/{y}.jpg';

View File

@@ -25,17 +25,17 @@ ol.source.OSM = function(opt_options) {
attributions = [ol.source.OSM.ATTRIBUTION]; attributions = [ol.source.OSM.ATTRIBUTION];
} }
var crossOrigin = goog.isDef(options.crossOrigin) ? var crossOrigin = options.crossOrigin !== undefined ?
options.crossOrigin : 'anonymous'; options.crossOrigin : 'anonymous';
var url = goog.isDef(options.url) ? var url = options.url !== undefined ?
options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'; options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
goog.base(this, { goog.base(this, {
attributions: attributions, attributions: attributions,
crossOrigin: crossOrigin, crossOrigin: crossOrigin,
opaque: true, opaque: true,
maxZoom: goog.isDef(options.maxZoom) ? options.maxZoom : 19, maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,
tileLoadFunction: options.tileLoadFunction, tileLoadFunction: options.tileLoadFunction,
url: url, url: url,
wrapX: options.wrapX wrapX: options.wrapX

View File

@@ -48,14 +48,14 @@ ol.source.Raster = function(options) {
* @private * @private
* @type {ol.raster.OperationType} * @type {ol.raster.OperationType}
*/ */
this.operationType_ = goog.isDef(options.operationType) ? this.operationType_ = options.operationType !== undefined ?
options.operationType : ol.raster.OperationType.PIXEL; options.operationType : ol.raster.OperationType.PIXEL;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.threads_ = goog.isDef(options.threads) ? options.threads : 1; this.threads_ = options.threads !== undefined ? options.threads : 1;
/** /**
* @private * @private

View File

@@ -57,7 +57,7 @@ ol.source.Source = function(options) {
* @private * @private
* @type {Array.<ol.Attribution>} * @type {Array.<ol.Attribution>}
*/ */
this.attributions_ = goog.isDef(options.attributions) ? this.attributions_ = options.attributions !== undefined ?
options.attributions : null; options.attributions : null;
/** /**
@@ -70,14 +70,14 @@ ol.source.Source = function(options) {
* @private * @private
* @type {ol.source.State} * @type {ol.source.State}
*/ */
this.state_ = goog.isDef(options.state) ? this.state_ = options.state !== undefined ?
options.state : ol.source.State.READY; options.state : ol.source.State.READY;
/** /**
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.wrapX_ = goog.isDef(options.wrapX) ? options.wrapX : false; this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false;
}; };
goog.inherits(ol.source.Source, ol.Object); goog.inherits(ol.source.Source, ol.Object);

View File

@@ -98,7 +98,7 @@ ol.source.Stamen = function(options) {
'known layer configured'); 'known layer configured');
var layerConfig = ol.source.StamenLayerConfig[options.layer]; var layerConfig = ol.source.StamenLayerConfig[options.layer];
var url = goog.isDef(options.url) ? options.url : var url = options.url !== undefined ? options.url :
'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer + 'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer +
'/{z}/{x}/{y}.' + layerConfig.extension; '/{z}/{x}/{y}.' + layerConfig.extension;

View File

@@ -34,7 +34,7 @@ ol.source.TileArcGISRest = function(opt_options) {
var options = opt_options || {}; var options = opt_options || {};
var params = goog.isDef(options.params) ? options.params : {}; var params = options.params !== undefined ? options.params : {};
goog.base(this, { goog.base(this, {
attributions: options.attributions, attributions: options.attributions,
@@ -44,11 +44,11 @@ ol.source.TileArcGISRest = function(opt_options) {
tileGrid: options.tileGrid, tileGrid: options.tileGrid,
tileLoadFunction: options.tileLoadFunction, tileLoadFunction: options.tileLoadFunction,
tileUrlFunction: goog.bind(this.tileUrlFunction_, this), tileUrlFunction: goog.bind(this.tileUrlFunction_, this),
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true wrapX: options.wrapX !== undefined ? options.wrapX : true
}); });
var urls = options.urls; var urls = options.urls;
if (urls === undefined && goog.isDef(options.url)) { if (urls === undefined && options.url !== undefined) {
urls = ol.TileUrlFunction.expandUrl(options.url); urls = ol.TileUrlFunction.expandUrl(options.url);
} }

View File

@@ -92,7 +92,7 @@ ol.source.TileDebug = function(options) {
opaque: false, opaque: false,
projection: options.projection, projection: options.projection,
tileGrid: options.tileGrid, tileGrid: options.tileGrid,
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true wrapX: options.wrapX !== undefined ? options.wrapX : true
}); });
}; };

View File

@@ -32,7 +32,7 @@ ol.source.TileImage = function(options) {
logo: options.logo, logo: options.logo,
opaque: options.opaque, opaque: options.opaque,
projection: options.projection, projection: options.projection,
state: goog.isDef(options.state) ? state: options.state !== undefined ?
/** @type {ol.source.State} */ (options.state) : undefined, /** @type {ol.source.State} */ (options.state) : undefined,
tileGrid: options.tileGrid, tileGrid: options.tileGrid,
tilePixelRatio: options.tilePixelRatio, tilePixelRatio: options.tilePixelRatio,
@@ -43,7 +43,7 @@ ol.source.TileImage = function(options) {
* @protected * @protected
* @type {ol.TileUrlFunctionType} * @type {ol.TileUrlFunctionType}
*/ */
this.tileUrlFunction = goog.isDef(options.tileUrlFunction) ? this.tileUrlFunction = options.tileUrlFunction !== undefined ?
options.tileUrlFunction : options.tileUrlFunction :
ol.TileUrlFunction.nullTileUrlFunction; ol.TileUrlFunction.nullTileUrlFunction;
@@ -52,13 +52,13 @@ ol.source.TileImage = function(options) {
* @type {?string} * @type {?string}
*/ */
this.crossOrigin = this.crossOrigin =
goog.isDef(options.crossOrigin) ? options.crossOrigin : null; options.crossOrigin !== undefined ? options.crossOrigin : null;
/** /**
* @protected * @protected
* @type {ol.TileLoadFunctionType} * @type {ol.TileLoadFunctionType}
*/ */
this.tileLoadFunction = goog.isDef(options.tileLoadFunction) ? this.tileLoadFunction = options.tileLoadFunction !== undefined ?
options.tileLoadFunction : ol.source.TileImage.defaultTileLoadFunction; options.tileLoadFunction : ol.source.TileImage.defaultTileLoadFunction;
/** /**
@@ -66,7 +66,7 @@ ol.source.TileImage = function(options) {
* @type {function(new: ol.ImageTile, ol.TileCoord, ol.TileState, string, * @type {function(new: ol.ImageTile, ol.TileCoord, ol.TileState, string,
* ?string, ol.TileLoadFunctionType)} * ?string, ol.TileLoadFunctionType)}
*/ */
this.tileClass = goog.isDef(options.tileClass) ? this.tileClass = options.tileClass !== undefined ?
options.tileClass : ol.ImageTile; options.tileClass : ol.ImageTile;
}; };

View File

@@ -36,7 +36,7 @@ ol.source.TileJSON = function(options) {
projection: ol.proj.get('EPSG:3857'), projection: ol.proj.get('EPSG:3857'),
state: ol.source.State.LOADING, state: ol.source.State.LOADING,
tileLoadFunction: options.tileLoadFunction, tileLoadFunction: options.tileLoadFunction,
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true wrapX: options.wrapX !== undefined ? options.wrapX : true
}); });
var request = new goog.net.Jsonp(options.url); var request = new goog.net.Jsonp(options.url);
@@ -77,7 +77,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
this.tileUrlFunction = ol.TileUrlFunction.createFromTemplates(tileJSON.tiles); this.tileUrlFunction = ol.TileUrlFunction.createFromTemplates(tileJSON.tiles);
if (goog.isDef(tileJSON.attribution) && if (tileJSON.attribution !== undefined &&
goog.isNull(this.getAttributions())) { goog.isNull(this.getAttributions())) {
var attributionExtent = extent !== undefined ? var attributionExtent = extent !== undefined ?
extent : epsg4326Projection.getExtent(); extent : epsg4326Projection.getExtent();

View File

@@ -56,20 +56,20 @@ ol.source.Tile = function(options) {
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.opaque_ = goog.isDef(options.opaque) ? options.opaque : false; this.opaque_ = options.opaque !== undefined ? options.opaque : false;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.tilePixelRatio_ = goog.isDef(options.tilePixelRatio) ? this.tilePixelRatio_ = options.tilePixelRatio !== undefined ?
options.tilePixelRatio : 1; options.tilePixelRatio : 1;
/** /**
* @protected * @protected
* @type {ol.tilegrid.TileGrid} * @type {ol.tilegrid.TileGrid}
*/ */
this.tileGrid = goog.isDef(options.tileGrid) ? options.tileGrid : null; this.tileGrid = options.tileGrid !== undefined ? options.tileGrid : null;
/** /**
* @protected * @protected

View File

@@ -35,7 +35,7 @@ ol.source.TileUTFGrid = function(options) {
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.preemptive_ = goog.isDef(options.preemptive) ? this.preemptive_ = options.preemptive !== undefined ?
options.preemptive : true; options.preemptive : true;
/** /**

View File

@@ -36,7 +36,7 @@ ol.source.TileVector = function(options) {
* @private * @private
* @type {ol.format.Feature|undefined} * @type {ol.format.Feature|undefined}
*/ */
this.format_ = goog.isDef(options.format) ? options.format : null; this.format_ = options.format !== undefined ? options.format : null;
/** /**
* @private * @private
@@ -54,7 +54,7 @@ ol.source.TileVector = function(options) {
* @private * @private
* @type {?ol.TileVectorLoadFunctionType} * @type {?ol.TileVectorLoadFunctionType}
*/ */
this.tileLoadFunction_ = goog.isDef(options.tileLoadFunction) ? this.tileLoadFunction_ = options.tileLoadFunction !== undefined ?
options.tileLoadFunction : null; options.tileLoadFunction : null;
goog.asserts.assert(!goog.isNull(this.format_) || goog.asserts.assert(!goog.isNull(this.format_) ||

View File

@@ -35,7 +35,7 @@ ol.source.TileWMS = function(opt_options) {
var options = opt_options || {}; var options = opt_options || {};
var params = goog.isDef(options.params) ? options.params : {}; var params = options.params !== undefined ? options.params : {};
var transparent = goog.object.get(params, 'TRANSPARENT', true); var transparent = goog.object.get(params, 'TRANSPARENT', true);
@@ -48,11 +48,11 @@ ol.source.TileWMS = function(opt_options) {
tileGrid: options.tileGrid, tileGrid: options.tileGrid,
tileLoadFunction: options.tileLoadFunction, tileLoadFunction: options.tileLoadFunction,
tileUrlFunction: goog.bind(this.tileUrlFunction_, this), tileUrlFunction: goog.bind(this.tileUrlFunction_, this),
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true wrapX: options.wrapX !== undefined ? options.wrapX : true
}); });
var urls = options.urls; var urls = options.urls;
if (urls === undefined && goog.isDef(options.url)) { if (urls === undefined && options.url !== undefined) {
urls = ol.TileUrlFunction.expandUrl(options.url); urls = ol.TileUrlFunction.expandUrl(options.url);
} }
@@ -66,7 +66,7 @@ ol.source.TileWMS = function(opt_options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.gutter_ = goog.isDef(options.gutter) ? options.gutter : 0; this.gutter_ = options.gutter !== undefined ? options.gutter : 0;
/** /**
* @private * @private
@@ -91,7 +91,7 @@ ol.source.TileWMS = function(opt_options) {
* @private * @private
* @type {boolean} * @type {boolean}
*/ */
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true; this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
/** /**
* @private * @private

View File

@@ -82,7 +82,7 @@ ol.source.Vector = function(opt_options) {
logo: options.logo, logo: options.logo,
projection: undefined, projection: undefined,
state: ol.source.State.READY, state: ol.source.State.READY,
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true wrapX: options.wrapX !== undefined ? options.wrapX : true
}); });
/** /**
@@ -94,7 +94,7 @@ ol.source.Vector = function(opt_options) {
if (options.loader !== undefined) { if (options.loader !== undefined) {
this.loader_ = options.loader; this.loader_ = options.loader;
} else if (options.url !== undefined) { } else if (options.url !== undefined) {
goog.asserts.assert(goog.isDef(options.format), goog.asserts.assert(options.format !== undefined,
'format must be set when url is set'); 'format must be set when url is set');
// create a XHR feature loader for "url" and "format" // create a XHR feature loader for "url" and "format"
this.loader_ = ol.featureloader.xhr(options.url, options.format); this.loader_ = ol.featureloader.xhr(options.url, options.format);
@@ -104,11 +104,11 @@ ol.source.Vector = function(opt_options) {
* @private * @private
* @type {ol.LoadingStrategy} * @type {ol.LoadingStrategy}
*/ */
this.strategy_ = goog.isDef(options.strategy) ? options.strategy : this.strategy_ = options.strategy !== undefined ? options.strategy :
ol.loadingstrategy.all; ol.loadingstrategy.all;
var useSpatialIndex = var useSpatialIndex =
goog.isDef(options.useSpatialIndex) ? options.useSpatialIndex : true; options.useSpatialIndex !== undefined ? options.useSpatialIndex : true;
/** /**
* @private * @private

View File

@@ -43,19 +43,19 @@ ol.source.WMTS = function(options) {
* @private * @private
* @type {string} * @type {string}
*/ */
this.version_ = goog.isDef(options.version) ? options.version : '1.0.0'; this.version_ = options.version !== undefined ? options.version : '1.0.0';
/** /**
* @private * @private
* @type {string} * @type {string}
*/ */
this.format_ = goog.isDef(options.format) ? options.format : 'image/jpeg'; this.format_ = options.format !== undefined ? options.format : 'image/jpeg';
/** /**
* @private * @private
* @type {Object} * @type {Object}
*/ */
this.dimensions_ = goog.isDef(options.dimensions) ? options.dimensions : {}; this.dimensions_ = options.dimensions !== undefined ? options.dimensions : {};
/** /**
* @private * @private
@@ -83,7 +83,7 @@ ol.source.WMTS = function(options) {
this.style_ = options.style; this.style_ = options.style;
var urls = options.urls; var urls = options.urls;
if (urls === undefined && goog.isDef(options.url)) { if (urls === undefined && options.url !== undefined) {
urls = ol.TileUrlFunction.expandUrl(options.url); urls = ol.TileUrlFunction.expandUrl(options.url);
} }
@@ -100,7 +100,7 @@ ol.source.WMTS = function(options) {
* @private * @private
* @type {ol.source.WMTSRequestEncoding} * @type {ol.source.WMTSRequestEncoding}
*/ */
this.requestEncoding_ = goog.isDef(options.requestEncoding) ? this.requestEncoding_ = options.requestEncoding !== undefined ?
/** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) : /** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) :
ol.source.WMTSRequestEncoding.KVP; ol.source.WMTSRequestEncoding.KVP;
@@ -190,7 +190,7 @@ ol.source.WMTS = function(options) {
tileLoadFunction: options.tileLoadFunction, tileLoadFunction: options.tileLoadFunction,
tilePixelRatio: options.tilePixelRatio, tilePixelRatio: options.tilePixelRatio,
tileUrlFunction: tileUrlFunction, tileUrlFunction: tileUrlFunction,
wrapX: goog.isDef(options.wrapX) ? options.wrapX : false wrapX: options.wrapX !== undefined ? options.wrapX : false
}); });
}; };

View File

@@ -28,10 +28,10 @@ goog.require('ol.source.TileImage');
* @api stable * @api stable
*/ */
ol.source.XYZ = function(options) { ol.source.XYZ = function(options) {
var projection = goog.isDef(options.projection) ? var projection = options.projection !== undefined ?
options.projection : 'EPSG:3857'; options.projection : 'EPSG:3857';
var tileGrid = goog.isDef(options.tileGrid) ? options.tileGrid : var tileGrid = options.tileGrid !== undefined ? options.tileGrid :
ol.tilegrid.createXYZ({ ol.tilegrid.createXYZ({
extent: ol.tilegrid.extentFromProjection(projection), extent: ol.tilegrid.extentFromProjection(projection),
maxZoom: options.maxZoom, maxZoom: options.maxZoom,
@@ -53,7 +53,7 @@ ol.source.XYZ = function(options) {
tileLoadFunction: options.tileLoadFunction, tileLoadFunction: options.tileLoadFunction,
tilePixelRatio: options.tilePixelRatio, tilePixelRatio: options.tilePixelRatio,
tileUrlFunction: ol.TileUrlFunction.nullTileUrlFunction, tileUrlFunction: ol.TileUrlFunction.nullTileUrlFunction,
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true wrapX: options.wrapX !== undefined ? options.wrapX : true
}); });
if (options.tileUrlFunction !== undefined) { if (options.tileUrlFunction !== undefined) {

View File

@@ -36,7 +36,7 @@ ol.source.Zoomify = function(opt_options) {
var options = opt_options || {}; var options = opt_options || {};
var size = options.size; var size = options.size;
var tierSizeCalculation = goog.isDef(options.tierSizeCalculation) ? var tierSizeCalculation = options.tierSizeCalculation !== undefined ?
options.tierSizeCalculation : options.tierSizeCalculation :
ol.source.ZoomifyTierSizeCalculation.DEFAULT; ol.source.ZoomifyTierSizeCalculation.DEFAULT;

View File

@@ -47,7 +47,7 @@ ol.style.AtlasManager = function(opt_options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.currentSize_ = goog.isDef(options.initialSize) ? this.currentSize_ = options.initialSize !== undefined ?
options.initialSize : ol.INITIAL_ATLAS_SIZE; options.initialSize : ol.INITIAL_ATLAS_SIZE;
/** /**
@@ -55,9 +55,9 @@ ol.style.AtlasManager = function(opt_options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.maxSize_ = goog.isDef(options.maxSize) ? this.maxSize_ = options.maxSize !== undefined ?
options.maxSize : ol.MAX_ATLAS_SIZE != -1 ? options.maxSize : ol.MAX_ATLAS_SIZE != -1 ?
ol.MAX_ATLAS_SIZE : goog.isDef(ol.WEBGL_MAX_TEXTURE_SIZE) ? ol.MAX_ATLAS_SIZE : ol.WEBGL_MAX_TEXTURE_SIZE !== undefined ?
ol.WEBGL_MAX_TEXTURE_SIZE : 2048; ol.WEBGL_MAX_TEXTURE_SIZE : 2048;
/** /**
@@ -65,7 +65,7 @@ ol.style.AtlasManager = function(opt_options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.space_ = goog.isDef(options.space) ? options.space : 1; this.space_ = options.space !== undefined ? options.space : 1;
/** /**
* @private * @private

View File

@@ -50,13 +50,13 @@ ol.style.Circle = function(opt_options) {
* @private * @private
* @type {ol.style.Fill} * @type {ol.style.Fill}
*/ */
this.fill_ = goog.isDef(options.fill) ? options.fill : null; this.fill_ = options.fill !== undefined ? options.fill : null;
/** /**
* @private * @private
* @type {ol.style.Stroke} * @type {ol.style.Stroke}
*/ */
this.stroke_ = goog.isDef(options.stroke) ? options.stroke : null; this.stroke_ = options.stroke !== undefined ? options.stroke : null;
/** /**
* @private * @private
@@ -99,7 +99,7 @@ ol.style.Circle = function(opt_options) {
/** /**
* @type {boolean} * @type {boolean}
*/ */
var snapToPixel = goog.isDef(options.snapToPixel) ? var snapToPixel = options.snapToPixel !== undefined ?
options.snapToPixel : true; options.snapToPixel : true;
goog.base(this, { goog.base(this, {
@@ -435,7 +435,7 @@ ol.style.Circle.prototype.getChecksum = function() {
if (recalculate) { if (recalculate) {
var checksum = 'c' + strokeChecksum + fillChecksum + var checksum = 'c' + strokeChecksum + fillChecksum +
(goog.isDef(this.radius_) ? this.radius_.toString() : '-'); (this.radius_ !== undefined ? this.radius_.toString() : '-');
this.checksums_ = [checksum, strokeChecksum, fillChecksum, this.radius_]; this.checksums_ = [checksum, strokeChecksum, fillChecksum, this.radius_];
} }

View File

@@ -22,7 +22,7 @@ ol.style.Fill = function(opt_options) {
* @private * @private
* @type {ol.Color|string} * @type {ol.Color|string}
*/ */
this.color_ = goog.isDef(options.color) ? options.color : null; this.color_ = options.color !== undefined ? options.color : null;
/** /**
* @private * @private

View File

@@ -55,7 +55,7 @@ ol.style.Icon = function(opt_options) {
* @private * @private
* @type {Array.<number>} * @type {Array.<number>}
*/ */
this.anchor_ = goog.isDef(options.anchor) ? options.anchor : [0.5, 0.5]; this.anchor_ = options.anchor !== undefined ? options.anchor : [0.5, 0.5];
/** /**
* @private * @private
@@ -67,38 +67,38 @@ ol.style.Icon = function(opt_options) {
* @private * @private
* @type {ol.style.IconOrigin} * @type {ol.style.IconOrigin}
*/ */
this.anchorOrigin_ = goog.isDef(options.anchorOrigin) ? this.anchorOrigin_ = options.anchorOrigin !== undefined ?
options.anchorOrigin : ol.style.IconOrigin.TOP_LEFT; options.anchorOrigin : ol.style.IconOrigin.TOP_LEFT;
/** /**
* @private * @private
* @type {ol.style.IconAnchorUnits} * @type {ol.style.IconAnchorUnits}
*/ */
this.anchorXUnits_ = goog.isDef(options.anchorXUnits) ? this.anchorXUnits_ = options.anchorXUnits !== undefined ?
options.anchorXUnits : ol.style.IconAnchorUnits.FRACTION; options.anchorXUnits : ol.style.IconAnchorUnits.FRACTION;
/** /**
* @private * @private
* @type {ol.style.IconAnchorUnits} * @type {ol.style.IconAnchorUnits}
*/ */
this.anchorYUnits_ = goog.isDef(options.anchorYUnits) ? this.anchorYUnits_ = options.anchorYUnits !== undefined ?
options.anchorYUnits : ol.style.IconAnchorUnits.FRACTION; options.anchorYUnits : ol.style.IconAnchorUnits.FRACTION;
/** /**
* @type {?string} * @type {?string}
*/ */
var crossOrigin = var crossOrigin =
goog.isDef(options.crossOrigin) ? options.crossOrigin : null; options.crossOrigin !== undefined ? options.crossOrigin : null;
/** /**
* @type {Image} * @type {Image}
*/ */
var image = goog.isDef(options.img) ? options.img : null; var image = options.img !== undefined ? options.img : null;
/** /**
* @type {ol.Size} * @type {ol.Size}
*/ */
var imgSize = goog.isDef(options.imgSize) ? options.imgSize : null; var imgSize = options.imgSize !== undefined ? options.imgSize : null;
/** /**
* @type {string|undefined} * @type {string|undefined}
@@ -123,7 +123,7 @@ ol.style.Icon = function(opt_options) {
/** /**
* @type {ol.style.ImageState} * @type {ol.style.ImageState}
*/ */
var imageState = goog.isDef(options.src) ? var imageState = options.src !== undefined ?
ol.style.ImageState.IDLE : ol.style.ImageState.LOADED; ol.style.ImageState.IDLE : ol.style.ImageState.LOADED;
/** /**
@@ -137,13 +137,13 @@ ol.style.Icon = function(opt_options) {
* @private * @private
* @type {Array.<number>} * @type {Array.<number>}
*/ */
this.offset_ = goog.isDef(options.offset) ? options.offset : [0, 0]; this.offset_ = options.offset !== undefined ? options.offset : [0, 0];
/** /**
* @private * @private
* @type {ol.style.IconOrigin} * @type {ol.style.IconOrigin}
*/ */
this.offsetOrigin_ = goog.isDef(options.offsetOrigin) ? this.offsetOrigin_ = options.offsetOrigin !== undefined ?
options.offsetOrigin : ol.style.IconOrigin.TOP_LEFT; options.offsetOrigin : ol.style.IconOrigin.TOP_LEFT;
/** /**
@@ -156,33 +156,33 @@ ol.style.Icon = function(opt_options) {
* @private * @private
* @type {ol.Size} * @type {ol.Size}
*/ */
this.size_ = goog.isDef(options.size) ? options.size : null; this.size_ = options.size !== undefined ? options.size : null;
/** /**
* @type {number} * @type {number}
*/ */
var opacity = goog.isDef(options.opacity) ? options.opacity : 1; var opacity = options.opacity !== undefined ? options.opacity : 1;
/** /**
* @type {boolean} * @type {boolean}
*/ */
var rotateWithView = goog.isDef(options.rotateWithView) ? var rotateWithView = options.rotateWithView !== undefined ?
options.rotateWithView : false; options.rotateWithView : false;
/** /**
* @type {number} * @type {number}
*/ */
var rotation = goog.isDef(options.rotation) ? options.rotation : 0; var rotation = options.rotation !== undefined ? options.rotation : 0;
/** /**
* @type {number} * @type {number}
*/ */
var scale = goog.isDef(options.scale) ? options.scale : 1; var scale = options.scale !== undefined ? options.scale : 1;
/** /**
* @type {boolean} * @type {boolean}
*/ */
var snapToPixel = goog.isDef(options.snapToPixel) ? var snapToPixel = options.snapToPixel !== undefined ?
options.snapToPixel : true; options.snapToPixel : true;
goog.base(this, { goog.base(this, {
@@ -553,7 +553,7 @@ ol.style.IconImage_.prototype.getSrc = function() {
*/ */
ol.style.IconImage_.prototype.load = function() { ol.style.IconImage_.prototype.load = function() {
if (this.imageState_ == ol.style.ImageState.IDLE) { if (this.imageState_ == ol.style.ImageState.IDLE) {
goog.asserts.assert(goog.isDef(this.src_), goog.asserts.assert(this.src_ !== undefined,
'this.src_ must not be undefined'); 'this.src_ must not be undefined');
goog.asserts.assert(goog.isNull(this.imageListenerKeys_), goog.asserts.assert(goog.isNull(this.imageListenerKeys_),
'no listener keys existing'); 'no listener keys existing');

View File

@@ -30,7 +30,7 @@ goog.require('ol.style.Stroke');
ol.style.RegularShape = function(options) { ol.style.RegularShape = function(options) {
goog.asserts.assert( goog.asserts.assert(
goog.isDef(options.radius) || goog.isDef(options.radius1), options.radius !== undefined || options.radius1 !== undefined,
'must provide either "radius" or "radius1"'); 'must provide either "radius" or "radius1"');
/** /**
@@ -55,7 +55,7 @@ ol.style.RegularShape = function(options) {
* @private * @private
* @type {ol.style.Fill} * @type {ol.style.Fill}
*/ */
this.fill_ = goog.isDef(options.fill) ? options.fill : null; this.fill_ = options.fill !== undefined ? options.fill : null;
/** /**
* @private * @private
@@ -73,7 +73,7 @@ ol.style.RegularShape = function(options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.radius_ = /** @type {number} */ (goog.isDef(options.radius) ? this.radius_ = /** @type {number} */ (options.radius !== undefined ?
options.radius : options.radius1); options.radius : options.radius1);
/** /**
@@ -81,19 +81,19 @@ ol.style.RegularShape = function(options) {
* @type {number} * @type {number}
*/ */
this.radius2_ = this.radius2_ =
goog.isDef(options.radius2) ? options.radius2 : this.radius_; options.radius2 !== undefined ? options.radius2 : this.radius_;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.angle_ = goog.isDef(options.angle) ? options.angle : 0; this.angle_ = options.angle !== undefined ? options.angle : 0;
/** /**
* @private * @private
* @type {ol.style.Stroke} * @type {ol.style.Stroke}
*/ */
this.stroke_ = goog.isDef(options.stroke) ? options.stroke : null; this.stroke_ = options.stroke !== undefined ? options.stroke : null;
/** /**
* @private * @private
@@ -124,13 +124,13 @@ ol.style.RegularShape = function(options) {
/** /**
* @type {boolean} * @type {boolean}
*/ */
var snapToPixel = goog.isDef(options.snapToPixel) ? var snapToPixel = options.snapToPixel !== undefined ?
options.snapToPixel : true; options.snapToPixel : true;
goog.base(this, { goog.base(this, {
opacity: 1, opacity: 1,
rotateWithView: false, rotateWithView: false,
rotation: goog.isDef(options.rotation) ? options.rotation : 0, rotation: options.rotation !== undefined ? options.rotation : 0,
scale: 1, scale: 1,
snapToPixel: snapToPixel snapToPixel: snapToPixel
}); });
@@ -536,10 +536,10 @@ ol.style.RegularShape.prototype.getChecksum = function() {
if (recalculate) { if (recalculate) {
var checksum = 'r' + strokeChecksum + fillChecksum + var checksum = 'r' + strokeChecksum + fillChecksum +
(goog.isDef(this.radius_) ? this.radius_.toString() : '-') + (this.radius_ !== undefined ? this.radius_.toString() : '-') +
(goog.isDef(this.radius2_) ? this.radius2_.toString() : '-') + (this.radius2_ !== undefined ? this.radius2_.toString() : '-') +
(goog.isDef(this.angle_) ? this.angle_.toString() : '-') + (this.angle_ !== undefined ? this.angle_.toString() : '-') +
(goog.isDef(this.points_) ? this.points_.toString() : '-'); (this.points_ !== undefined ? this.points_.toString() : '-');
this.checksums_ = [checksum, strokeChecksum, fillChecksum, this.checksums_ = [checksum, strokeChecksum, fillChecksum,
this.radius_, this.radius2_, this.angle_, this.points_]; this.radius_, this.radius2_, this.angle_, this.points_];
} }

View File

@@ -27,7 +27,7 @@ ol.style.Stroke = function(opt_options) {
* @private * @private
* @type {ol.Color|string} * @type {ol.Color|string}
*/ */
this.color_ = goog.isDef(options.color) ? options.color : null; this.color_ = options.color !== undefined ? options.color : null;
/** /**
* @private * @private
@@ -39,7 +39,7 @@ ol.style.Stroke = function(opt_options) {
* @private * @private
* @type {Array.<number>} * @type {Array.<number>}
*/ */
this.lineDash_ = goog.isDef(options.lineDash) ? options.lineDash : null; this.lineDash_ = options.lineDash !== undefined ? options.lineDash : null;
/** /**
* @private * @private
@@ -207,15 +207,15 @@ ol.style.Stroke.prototype.getChecksum = function() {
var raw = 's' + var raw = 's' +
(!goog.isNull(this.color_) ? (!goog.isNull(this.color_) ?
ol.color.asString(this.color_) : '-') + ',' + ol.color.asString(this.color_) : '-') + ',' +
(goog.isDef(this.lineCap_) ? (this.lineCap_ !== undefined ?
this.lineCap_.toString() : '-') + ',' + this.lineCap_.toString() : '-') + ',' +
(!goog.isNull(this.lineDash_) ? (!goog.isNull(this.lineDash_) ?
this.lineDash_.toString() : '-') + ',' + this.lineDash_.toString() : '-') + ',' +
(goog.isDef(this.lineJoin_) ? (this.lineJoin_ !== undefined ?
this.lineJoin_ : '-') + ',' + this.lineJoin_ : '-') + ',' +
(goog.isDef(this.miterLimit_) ? (this.miterLimit_ !== undefined ?
this.miterLimit_.toString() : '-') + ',' + this.miterLimit_.toString() : '-') + ',' +
(goog.isDef(this.width_) ? (this.width_ !== undefined ?
this.width_.toString() : '-'); this.width_.toString() : '-');
var md5 = new goog.crypt.Md5(); var md5 = new goog.crypt.Md5();

View File

@@ -48,25 +48,25 @@ ol.style.Style = function(opt_options) {
* @private * @private
* @type {ol.style.Fill} * @type {ol.style.Fill}
*/ */
this.fill_ = goog.isDef(options.fill) ? options.fill : null; this.fill_ = options.fill !== undefined ? options.fill : null;
/** /**
* @private * @private
* @type {ol.style.Image} * @type {ol.style.Image}
*/ */
this.image_ = goog.isDef(options.image) ? options.image : null; this.image_ = options.image !== undefined ? options.image : null;
/** /**
* @private * @private
* @type {ol.style.Stroke} * @type {ol.style.Stroke}
*/ */
this.stroke_ = goog.isDef(options.stroke) ? options.stroke : null; this.stroke_ = options.stroke !== undefined ? options.stroke : null;
/** /**
* @private * @private
* @type {ol.style.Text} * @type {ol.style.Text}
*/ */
this.text_ = goog.isDef(options.text) ? options.text : null; this.text_ = options.text !== undefined ? options.text : null;
/** /**
* @private * @private

View File

@@ -57,26 +57,26 @@ ol.style.Text = function(opt_options) {
* @private * @private
* @type {ol.style.Fill} * @type {ol.style.Fill}
*/ */
this.fill_ = goog.isDef(options.fill) ? options.fill : this.fill_ = options.fill !== undefined ? options.fill :
new ol.style.Fill({color: ol.style.Text.DEFAULT_FILL_COLOR_}); new ol.style.Fill({color: ol.style.Text.DEFAULT_FILL_COLOR_});
/** /**
* @private * @private
* @type {ol.style.Stroke} * @type {ol.style.Stroke}
*/ */
this.stroke_ = goog.isDef(options.stroke) ? options.stroke : null; this.stroke_ = options.stroke !== undefined ? options.stroke : null;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.offsetX_ = goog.isDef(options.offsetX) ? options.offsetX : 0; this.offsetX_ = options.offsetX !== undefined ? options.offsetX : 0;
/** /**
* @private * @private
* @type {number} * @type {number}
*/ */
this.offsetY_ = goog.isDef(options.offsetY) ? options.offsetY : 0; this.offsetY_ = options.offsetY !== undefined ? options.offsetY : 0;
}; };

View File

@@ -36,7 +36,7 @@ ol.tilegrid.TileGrid = function(options) {
* @protected * @protected
* @type {number} * @type {number}
*/ */
this.minZoom = goog.isDef(options.minZoom) ? options.minZoom : 0; this.minZoom = options.minZoom !== undefined ? options.minZoom : 0;
/** /**
* @private * @private
@@ -57,7 +57,7 @@ ol.tilegrid.TileGrid = function(options) {
* @private * @private
* @type {ol.Coordinate} * @type {ol.Coordinate}
*/ */
this.origin_ = goog.isDef(options.origin) ? options.origin : null; this.origin_ = options.origin !== undefined ? options.origin : null;
/** /**
* @private * @private
@@ -97,7 +97,7 @@ ol.tilegrid.TileGrid = function(options) {
* @private * @private
* @type {number|ol.Size} * @type {number|ol.Size}
*/ */
this.tileSize_ = goog.isDef(options.tileSize) ? this.tileSize_ = options.tileSize !== undefined ?
options.tileSize : options.tileSize :
goog.isNull(this.tileSizes_) ? ol.DEFAULT_TILE_SIZE : null; goog.isNull(this.tileSizes_) ? ol.DEFAULT_TILE_SIZE : null;
goog.asserts.assert( goog.asserts.assert(

View File

@@ -112,7 +112,7 @@ ol.View = function(opt_options) {
* @type {Object.<string, *>} * @type {Object.<string, *>}
*/ */
var properties = {}; var properties = {};
properties[ol.ViewProperty.CENTER] = goog.isDef(options.center) ? properties[ol.ViewProperty.CENTER] = options.center !== undefined ?
options.center : null; options.center : null;
/** /**
@@ -161,7 +161,7 @@ ol.View = function(opt_options) {
this.maxResolution_, options.zoom - this.minZoom_); this.maxResolution_, options.zoom - this.minZoom_);
} }
properties[ol.ViewProperty.ROTATION] = properties[ol.ViewProperty.ROTATION] =
goog.isDef(options.rotation) ? options.rotation : 0; options.rotation !== undefined ? options.rotation : 0;
this.setProperties(properties); this.setProperties(properties);
}; };
goog.inherits(ol.View, ol.Object); goog.inherits(ol.View, ol.Object);
@@ -458,10 +458,10 @@ ol.View.prototype.fit = function(geometry, size, opt_options) {
var options = opt_options || {}; var options = opt_options || {};
var padding = goog.isDef(options.padding) ? options.padding : [0, 0, 0, 0]; var padding = options.padding !== undefined ? options.padding : [0, 0, 0, 0];
var constrainResolution = goog.isDef(options.constrainResolution) ? var constrainResolution = options.constrainResolution !== undefined ?
options.constrainResolution : true; options.constrainResolution : true;
var nearest = goog.isDef(options.nearest) ? options.nearest : false; var nearest = options.nearest !== undefined ? options.nearest : false;
var minResolution; var minResolution;
if (options.minResolution !== undefined) { if (options.minResolution !== undefined) {
minResolution = options.minResolution; minResolution = options.minResolution;
@@ -662,13 +662,13 @@ ol.View.createResolutionConstraint_ = function(options) {
var defaultMaxZoom = 28; var defaultMaxZoom = 28;
var defaultZoomFactor = 2; var defaultZoomFactor = 2;
var minZoom = goog.isDef(options.minZoom) ? var minZoom = options.minZoom !== undefined ?
options.minZoom : ol.DEFAULT_MIN_ZOOM; options.minZoom : ol.DEFAULT_MIN_ZOOM;
var maxZoom = goog.isDef(options.maxZoom) ? var maxZoom = options.maxZoom !== undefined ?
options.maxZoom : defaultMaxZoom; options.maxZoom : defaultMaxZoom;
var zoomFactor = goog.isDef(options.zoomFactor) ? var zoomFactor = options.zoomFactor !== undefined ?
options.zoomFactor : defaultZoomFactor; options.zoomFactor : defaultZoomFactor;
if (options.resolutions !== undefined) { if (options.resolutions !== undefined) {
@@ -734,7 +734,7 @@ ol.View.createResolutionConstraint_ = function(options) {
* @return {ol.RotationConstraintType} Rotation constraint. * @return {ol.RotationConstraintType} Rotation constraint.
*/ */
ol.View.createRotationConstraint_ = function(options) { ol.View.createRotationConstraint_ = function(options) {
var enableRotation = goog.isDef(options.enableRotation) ? var enableRotation = options.enableRotation !== undefined ?
options.enableRotation : true; options.enableRotation : true;
if (enableRotation) { if (enableRotation) {
var constrainRotation = options.constrainRotation; var constrainRotation = options.constrainRotation;

View File

@@ -194,7 +194,7 @@ ol.xml.isNode_ = function(value) {
* @return {boolean} Is node. * @return {boolean} Is node.
*/ */
ol.xml.isNodeIE_ = function(value) { ol.xml.isNodeIE_ = function(value) {
return goog.isObject(value) && goog.isDef(value.nodeType); return goog.isObject(value) && value.nodeType !== undefined;
}; };