Inline goog.isDef() calls for properties
This commit is contained in:
@@ -32,20 +32,20 @@ ol.source.BingMaps = function(options) {
|
||||
projection: ol.proj.get('EPSG:3857'),
|
||||
state: ol.source.State.LOADING,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
});
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string}
|
||||
*/
|
||||
this.culture_ = goog.isDef(options.culture) ? options.culture : 'en-us';
|
||||
this.culture_ = options.culture !== undefined ? options.culture : 'en-us';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.maxZoom_ = goog.isDef(options.maxZoom) ? options.maxZoom : -1;
|
||||
this.maxZoom_ = options.maxZoom !== undefined ? options.maxZoom : -1;
|
||||
|
||||
var uri = new goog.Uri(
|
||||
'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/' +
|
||||
|
||||
@@ -42,7 +42,7 @@ ol.source.Cluster = function(options) {
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.distance_ = goog.isDef(options.distance) ? options.distance : 20;
|
||||
this.distance_ = options.distance !== undefined ? options.distance : 20;
|
||||
|
||||
/**
|
||||
* @type {Array.<ol.Feature>}
|
||||
|
||||
@@ -23,7 +23,7 @@ ol.source.ImageCanvas = function(options) {
|
||||
logo: options.logo,
|
||||
projection: options.projection,
|
||||
resolutions: options.resolutions,
|
||||
state: goog.isDef(options.state) ?
|
||||
state: options.state !== undefined ?
|
||||
/** @type {ol.source.State} */ (options.state) : undefined
|
||||
});
|
||||
|
||||
@@ -49,7 +49,7 @@ ol.source.ImageCanvas = function(options) {
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.ratio_ = goog.isDef(options.ratio) ?
|
||||
this.ratio_ = options.ratio !== undefined ?
|
||||
options.ratio : 1.5;
|
||||
|
||||
};
|
||||
|
||||
@@ -34,20 +34,20 @@ ol.source.ImageMapGuide = function(options) {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.crossOrigin_ =
|
||||
goog.isDef(options.crossOrigin) ? options.crossOrigin : null;
|
||||
options.crossOrigin !== undefined ? options.crossOrigin : null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.displayDpi_ = goog.isDef(options.displayDpi) ?
|
||||
this.displayDpi_ = options.displayDpi !== undefined ?
|
||||
options.displayDpi : 96;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object}
|
||||
*/
|
||||
this.params_ = goog.isDef(options.params) ? options.params : {};
|
||||
this.params_ = options.params !== undefined ? options.params : {};
|
||||
|
||||
var imageUrlFunction;
|
||||
if (options.url !== undefined) {
|
||||
@@ -67,33 +67,33 @@ ol.source.ImageMapGuide = function(options) {
|
||||
* @private
|
||||
* @type {ol.ImageLoadFunctionType}
|
||||
*/
|
||||
this.imageLoadFunction_ = goog.isDef(options.imageLoadFunction) ?
|
||||
this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?
|
||||
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true;
|
||||
this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.metersPerUnit_ = goog.isDef(options.metersPerUnit) ?
|
||||
this.metersPerUnit_ = options.metersPerUnit !== undefined ?
|
||||
options.metersPerUnit : 1;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.ratio_ = goog.isDef(options.ratio) ? options.ratio : 1;
|
||||
this.ratio_ = options.ratio !== undefined ? options.ratio : 1;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.useOverlay_ = goog.isDef(options.useOverlay) ?
|
||||
this.useOverlay_ = options.useOverlay !== undefined ?
|
||||
options.useOverlay : false;
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ ol.source.Image = function(options) {
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
*/
|
||||
this.resolutions_ = goog.isDef(options.resolutions) ?
|
||||
this.resolutions_ = options.resolutions !== undefined ?
|
||||
options.resolutions : null;
|
||||
goog.asserts.assert(goog.isNull(this.resolutions_) ||
|
||||
goog.array.isSorted(this.resolutions_,
|
||||
|
||||
@@ -21,7 +21,7 @@ goog.require('ol.source.Image');
|
||||
*/
|
||||
ol.source.ImageStatic = function(options) {
|
||||
|
||||
var attributions = goog.isDef(options.attributions) ?
|
||||
var attributions = options.attributions !== undefined ?
|
||||
options.attributions : null;
|
||||
|
||||
var imageExtent = options.imageExtent;
|
||||
@@ -32,11 +32,11 @@ ol.source.ImageStatic = function(options) {
|
||||
resolutions = [resolution];
|
||||
}
|
||||
|
||||
var crossOrigin = goog.isDef(options.crossOrigin) ?
|
||||
var crossOrigin = options.crossOrigin !== undefined ?
|
||||
options.crossOrigin : null;
|
||||
|
||||
var /** @type {ol.ImageLoadFunctionType} */ imageLoadFunction =
|
||||
goog.isDef(options.imageLoadFunction) ?
|
||||
options.imageLoadFunction !== undefined ?
|
||||
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
|
||||
|
||||
goog.base(this, {
|
||||
|
||||
@@ -45,7 +45,7 @@ ol.source.ImageWMS = function(opt_options) {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.crossOrigin_ =
|
||||
goog.isDef(options.crossOrigin) ? options.crossOrigin : null;
|
||||
options.crossOrigin !== undefined ? options.crossOrigin : null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -57,7 +57,7 @@ ol.source.ImageWMS = function(opt_options) {
|
||||
* @private
|
||||
* @type {ol.ImageLoadFunctionType}
|
||||
*/
|
||||
this.imageLoadFunction_ = goog.isDef(options.imageLoadFunction) ?
|
||||
this.imageLoadFunction_ = options.imageLoadFunction !== undefined ?
|
||||
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ ol.source.ImageWMS = function(opt_options) {
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true;
|
||||
this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -108,7 +108,7 @@ ol.source.ImageWMS = function(opt_options) {
|
||||
* @private
|
||||
* @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);
|
||||
@@ -281,7 +281,7 @@ ol.source.ImageWMS.prototype.getImageLoadFunction = function() {
|
||||
ol.source.ImageWMS.prototype.getRequestUrl_ =
|
||||
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();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ ol.source.MapQuest = function(opt_options) {
|
||||
*/
|
||||
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/' +
|
||||
this.layer_ + '/{z}/{x}/{y}.jpg';
|
||||
|
||||
|
||||
@@ -25,17 +25,17 @@ ol.source.OSM = function(opt_options) {
|
||||
attributions = [ol.source.OSM.ATTRIBUTION];
|
||||
}
|
||||
|
||||
var crossOrigin = goog.isDef(options.crossOrigin) ?
|
||||
var crossOrigin = options.crossOrigin !== undefined ?
|
||||
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';
|
||||
|
||||
goog.base(this, {
|
||||
attributions: attributions,
|
||||
crossOrigin: crossOrigin,
|
||||
opaque: true,
|
||||
maxZoom: goog.isDef(options.maxZoom) ? options.maxZoom : 19,
|
||||
maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
url: url,
|
||||
wrapX: options.wrapX
|
||||
|
||||
@@ -48,14 +48,14 @@ ol.source.Raster = function(options) {
|
||||
* @private
|
||||
* @type {ol.raster.OperationType}
|
||||
*/
|
||||
this.operationType_ = goog.isDef(options.operationType) ?
|
||||
this.operationType_ = options.operationType !== undefined ?
|
||||
options.operationType : ol.raster.OperationType.PIXEL;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.threads_ = goog.isDef(options.threads) ? options.threads : 1;
|
||||
this.threads_ = options.threads !== undefined ? options.threads : 1;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -57,7 +57,7 @@ ol.source.Source = function(options) {
|
||||
* @private
|
||||
* @type {Array.<ol.Attribution>}
|
||||
*/
|
||||
this.attributions_ = goog.isDef(options.attributions) ?
|
||||
this.attributions_ = options.attributions !== undefined ?
|
||||
options.attributions : null;
|
||||
|
||||
/**
|
||||
@@ -70,14 +70,14 @@ ol.source.Source = function(options) {
|
||||
* @private
|
||||
* @type {ol.source.State}
|
||||
*/
|
||||
this.state_ = goog.isDef(options.state) ?
|
||||
this.state_ = options.state !== undefined ?
|
||||
options.state : ol.source.State.READY;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @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);
|
||||
|
||||
@@ -98,7 +98,7 @@ ol.source.Stamen = function(options) {
|
||||
'known layer configured');
|
||||
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 +
|
||||
'/{z}/{x}/{y}.' + layerConfig.extension;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ ol.source.TileArcGISRest = function(opt_options) {
|
||||
|
||||
var options = opt_options || {};
|
||||
|
||||
var params = goog.isDef(options.params) ? options.params : {};
|
||||
var params = options.params !== undefined ? options.params : {};
|
||||
|
||||
goog.base(this, {
|
||||
attributions: options.attributions,
|
||||
@@ -44,11 +44,11 @@ ol.source.TileArcGISRest = function(opt_options) {
|
||||
tileGrid: options.tileGrid,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
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;
|
||||
if (urls === undefined && goog.isDef(options.url)) {
|
||||
if (urls === undefined && options.url !== undefined) {
|
||||
urls = ol.TileUrlFunction.expandUrl(options.url);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ ol.source.TileDebug = function(options) {
|
||||
opaque: false,
|
||||
projection: options.projection,
|
||||
tileGrid: options.tileGrid,
|
||||
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ ol.source.TileImage = function(options) {
|
||||
logo: options.logo,
|
||||
opaque: options.opaque,
|
||||
projection: options.projection,
|
||||
state: goog.isDef(options.state) ?
|
||||
state: options.state !== undefined ?
|
||||
/** @type {ol.source.State} */ (options.state) : undefined,
|
||||
tileGrid: options.tileGrid,
|
||||
tilePixelRatio: options.tilePixelRatio,
|
||||
@@ -43,7 +43,7 @@ ol.source.TileImage = function(options) {
|
||||
* @protected
|
||||
* @type {ol.TileUrlFunctionType}
|
||||
*/
|
||||
this.tileUrlFunction = goog.isDef(options.tileUrlFunction) ?
|
||||
this.tileUrlFunction = options.tileUrlFunction !== undefined ?
|
||||
options.tileUrlFunction :
|
||||
ol.TileUrlFunction.nullTileUrlFunction;
|
||||
|
||||
@@ -52,13 +52,13 @@ ol.source.TileImage = function(options) {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.crossOrigin =
|
||||
goog.isDef(options.crossOrigin) ? options.crossOrigin : null;
|
||||
options.crossOrigin !== undefined ? options.crossOrigin : null;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {ol.TileLoadFunctionType}
|
||||
*/
|
||||
this.tileLoadFunction = goog.isDef(options.tileLoadFunction) ?
|
||||
this.tileLoadFunction = options.tileLoadFunction !== undefined ?
|
||||
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,
|
||||
* ?string, ol.TileLoadFunctionType)}
|
||||
*/
|
||||
this.tileClass = goog.isDef(options.tileClass) ?
|
||||
this.tileClass = options.tileClass !== undefined ?
|
||||
options.tileClass : ol.ImageTile;
|
||||
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ ol.source.TileJSON = function(options) {
|
||||
projection: ol.proj.get('EPSG:3857'),
|
||||
state: ol.source.State.LOADING,
|
||||
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);
|
||||
@@ -77,7 +77,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
|
||||
this.tileUrlFunction = ol.TileUrlFunction.createFromTemplates(tileJSON.tiles);
|
||||
|
||||
if (goog.isDef(tileJSON.attribution) &&
|
||||
if (tileJSON.attribution !== undefined &&
|
||||
goog.isNull(this.getAttributions())) {
|
||||
var attributionExtent = extent !== undefined ?
|
||||
extent : epsg4326Projection.getExtent();
|
||||
|
||||
@@ -56,20 +56,20 @@ ol.source.Tile = function(options) {
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.opaque_ = goog.isDef(options.opaque) ? options.opaque : false;
|
||||
this.opaque_ = options.opaque !== undefined ? options.opaque : false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.tilePixelRatio_ = goog.isDef(options.tilePixelRatio) ?
|
||||
this.tilePixelRatio_ = options.tilePixelRatio !== undefined ?
|
||||
options.tilePixelRatio : 1;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {ol.tilegrid.TileGrid}
|
||||
*/
|
||||
this.tileGrid = goog.isDef(options.tileGrid) ? options.tileGrid : null;
|
||||
this.tileGrid = options.tileGrid !== undefined ? options.tileGrid : null;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
|
||||
@@ -35,7 +35,7 @@ ol.source.TileUTFGrid = function(options) {
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.preemptive_ = goog.isDef(options.preemptive) ?
|
||||
this.preemptive_ = options.preemptive !== undefined ?
|
||||
options.preemptive : true;
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,7 +36,7 @@ ol.source.TileVector = function(options) {
|
||||
* @private
|
||||
* @type {ol.format.Feature|undefined}
|
||||
*/
|
||||
this.format_ = goog.isDef(options.format) ? options.format : null;
|
||||
this.format_ = options.format !== undefined ? options.format : null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -54,7 +54,7 @@ ol.source.TileVector = function(options) {
|
||||
* @private
|
||||
* @type {?ol.TileVectorLoadFunctionType}
|
||||
*/
|
||||
this.tileLoadFunction_ = goog.isDef(options.tileLoadFunction) ?
|
||||
this.tileLoadFunction_ = options.tileLoadFunction !== undefined ?
|
||||
options.tileLoadFunction : null;
|
||||
|
||||
goog.asserts.assert(!goog.isNull(this.format_) ||
|
||||
|
||||
@@ -35,7 +35,7 @@ ol.source.TileWMS = function(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);
|
||||
|
||||
@@ -48,11 +48,11 @@ ol.source.TileWMS = function(opt_options) {
|
||||
tileGrid: options.tileGrid,
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
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;
|
||||
if (urls === undefined && goog.isDef(options.url)) {
|
||||
if (urls === undefined && options.url !== undefined) {
|
||||
urls = ol.TileUrlFunction.expandUrl(options.url);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ ol.source.TileWMS = function(opt_options) {
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.gutter_ = goog.isDef(options.gutter) ? options.gutter : 0;
|
||||
this.gutter_ = options.gutter !== undefined ? options.gutter : 0;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -91,7 +91,7 @@ ol.source.TileWMS = function(opt_options) {
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.hidpi_ = goog.isDef(options.hidpi) ? options.hidpi : true;
|
||||
this.hidpi_ = options.hidpi !== undefined ? options.hidpi : true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -82,7 +82,7 @@ ol.source.Vector = function(opt_options) {
|
||||
logo: options.logo,
|
||||
projection: undefined,
|
||||
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) {
|
||||
this.loader_ = options.loader;
|
||||
} 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');
|
||||
// create a XHR feature loader for "url" and "format"
|
||||
this.loader_ = ol.featureloader.xhr(options.url, options.format);
|
||||
@@ -104,11 +104,11 @@ ol.source.Vector = function(opt_options) {
|
||||
* @private
|
||||
* @type {ol.LoadingStrategy}
|
||||
*/
|
||||
this.strategy_ = goog.isDef(options.strategy) ? options.strategy :
|
||||
this.strategy_ = options.strategy !== undefined ? options.strategy :
|
||||
ol.loadingstrategy.all;
|
||||
|
||||
var useSpatialIndex =
|
||||
goog.isDef(options.useSpatialIndex) ? options.useSpatialIndex : true;
|
||||
options.useSpatialIndex !== undefined ? options.useSpatialIndex : true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -43,19 +43,19 @@ ol.source.WMTS = function(options) {
|
||||
* @private
|
||||
* @type {string}
|
||||
*/
|
||||
this.version_ = goog.isDef(options.version) ? options.version : '1.0.0';
|
||||
this.version_ = options.version !== undefined ? options.version : '1.0.0';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string}
|
||||
*/
|
||||
this.format_ = goog.isDef(options.format) ? options.format : 'image/jpeg';
|
||||
this.format_ = options.format !== undefined ? options.format : 'image/jpeg';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object}
|
||||
*/
|
||||
this.dimensions_ = goog.isDef(options.dimensions) ? options.dimensions : {};
|
||||
this.dimensions_ = options.dimensions !== undefined ? options.dimensions : {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -83,7 +83,7 @@ ol.source.WMTS = function(options) {
|
||||
this.style_ = options.style;
|
||||
|
||||
var urls = options.urls;
|
||||
if (urls === undefined && goog.isDef(options.url)) {
|
||||
if (urls === undefined && options.url !== undefined) {
|
||||
urls = ol.TileUrlFunction.expandUrl(options.url);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ ol.source.WMTS = function(options) {
|
||||
* @private
|
||||
* @type {ol.source.WMTSRequestEncoding}
|
||||
*/
|
||||
this.requestEncoding_ = goog.isDef(options.requestEncoding) ?
|
||||
this.requestEncoding_ = options.requestEncoding !== undefined ?
|
||||
/** @type {ol.source.WMTSRequestEncoding} */ (options.requestEncoding) :
|
||||
ol.source.WMTSRequestEncoding.KVP;
|
||||
|
||||
@@ -190,7 +190,7 @@ ol.source.WMTS = function(options) {
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
tilePixelRatio: options.tilePixelRatio,
|
||||
tileUrlFunction: tileUrlFunction,
|
||||
wrapX: goog.isDef(options.wrapX) ? options.wrapX : false
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : false
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -28,10 +28,10 @@ goog.require('ol.source.TileImage');
|
||||
* @api stable
|
||||
*/
|
||||
ol.source.XYZ = function(options) {
|
||||
var projection = goog.isDef(options.projection) ?
|
||||
var projection = options.projection !== undefined ?
|
||||
options.projection : 'EPSG:3857';
|
||||
|
||||
var tileGrid = goog.isDef(options.tileGrid) ? options.tileGrid :
|
||||
var tileGrid = options.tileGrid !== undefined ? options.tileGrid :
|
||||
ol.tilegrid.createXYZ({
|
||||
extent: ol.tilegrid.extentFromProjection(projection),
|
||||
maxZoom: options.maxZoom,
|
||||
@@ -53,7 +53,7 @@ ol.source.XYZ = function(options) {
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
tilePixelRatio: options.tilePixelRatio,
|
||||
tileUrlFunction: ol.TileUrlFunction.nullTileUrlFunction,
|
||||
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true
|
||||
wrapX: options.wrapX !== undefined ? options.wrapX : true
|
||||
});
|
||||
|
||||
if (options.tileUrlFunction !== undefined) {
|
||||
|
||||
@@ -36,7 +36,7 @@ ol.source.Zoomify = function(opt_options) {
|
||||
var options = opt_options || {};
|
||||
|
||||
var size = options.size;
|
||||
var tierSizeCalculation = goog.isDef(options.tierSizeCalculation) ?
|
||||
var tierSizeCalculation = options.tierSizeCalculation !== undefined ?
|
||||
options.tierSizeCalculation :
|
||||
ol.source.ZoomifyTierSizeCalculation.DEFAULT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user