Shuffle assertions

This commit is contained in:
Tim Schaub
2016-08-09 00:05:25 -06:00
parent c40e1bc29b
commit d02cf1e7a9
39 changed files with 154 additions and 143 deletions

View File

@@ -55,7 +55,7 @@ ol.source.Cluster = function(options) {
*/
this.geometryFunction_ = options.geometryFunction || function(feature) {
var geometry = /** @type {ol.geom.Point} */ (feature.getGeometry());
ol.assert(geometry instanceof ol.geom.Point,
ol.asserts.assert(geometry instanceof ol.geom.Point,
10); // The default `geometryFunction` can only handle `ol.geom.Point` geometries
return geometry;
};

View File

@@ -211,7 +211,7 @@ ol.source.ImageArcGISRest.prototype.getRequestUrl_ = function(extent, size, pixe
.replace(/MapServer\/?$/, 'MapServer/export')
.replace(/ImageServer\/?$/, 'ImageServer/exportImage');
if (modifiedUrl == url) {
ol.assert(false, 50); // `options.featureTypes` should be an Array
ol.asserts.assert(false, 50); // `options.featureTypes` should be an Array
}
return ol.uri.appendParams(modifiedUrl, params);
};

View File

@@ -267,7 +267,7 @@ ol.source.ImageWMS.prototype.getImageLoadFunction = function() {
*/
ol.source.ImageWMS.prototype.getRequestUrl_ = function(extent, size, pixelRatio, projection, params) {
ol.assert(this.url_ !== undefined, 9); // `url` must be configured or set using `#setUrl()`
ol.asserts.assert(this.url_ !== undefined, 9); // `url` must be configured or set using `#setUrl()`
params[this.v13_ ? 'CRS' : 'SRS'] = projection.getCode();
@@ -293,7 +293,7 @@ ol.source.ImageWMS.prototype.getRequestUrl_ = function(extent, size, pixelRatio,
params['DPI'] = 90 * pixelRatio;
break;
default:
ol.assert(false, 8); // Unknown `serverType` configured
ol.asserts.assert(false, 8); // Unknown `serverType` configured
break;
}
}

View File

@@ -110,7 +110,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ = function(tileCoord, tileSize
.replace(/MapServer\/?$/, 'MapServer/export')
.replace(/ImageServer\/?$/, 'ImageServer/exportImage');
if (modifiedUrl == url) {
ol.assert(false, 50); // Cannot determine Rest Service from url
ol.asserts.assert(false, 50); // Cannot determine Rest Service from url
}
return ol.uri.appendParams(modifiedUrl, params);
};

View File

@@ -69,7 +69,7 @@ ol.source.TileUTFGrid = function(options) {
} else if (options.tileJSON) {
this.handleTileJSONResponse(options.tileJSON);
} else {
ol.assert(false, 51); // Either `url` or `tileJSON` options must be provided
ol.asserts.assert(false, 51); // Either `url` or `tileJSON` options must be provided
}
};
ol.inherits(ol.source.TileUTFGrid, ol.source.Tile);

View File

@@ -237,7 +237,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileE
params['DPI'] = 90 * pixelRatio;
break;
default:
ol.assert(false, 52); // Unknown `serverType` configured
ol.asserts.assert(false, 52); // Unknown `serverType` configured
break;
}
}

View File

@@ -101,7 +101,7 @@ ol.source.Vector = function(opt_options) {
if (options.loader !== undefined) {
this.loader_ = options.loader;
} else if (this.url_ !== undefined) {
ol.assert(this.format_, 7); // `format` must be set when `url` is set
ol.asserts.assert(this.format_, 7); // `format` must be set when `url` is set
// create a XHR feature loader for "url" and "format"
this.loader_ = ol.featureloader.xhr(this.url_, /** @type {ol.format.Feature} */ (this.format_));
}
@@ -257,7 +257,7 @@ ol.source.Vector.prototype.addToIndex_ = function(featureKey, feature) {
valid = false;
}
} else {
ol.assert(!(featureKey in this.undefIdIndex_),
ol.asserts.assert(!(featureKey in this.undefIdIndex_),
30); // The passed `feature` was already added to the source
this.undefIdIndex_[featureKey] = feature;
}

View File

@@ -64,7 +64,7 @@ ol.source.Zoomify = function(opt_options) {
}
break;
default:
ol.assert(false, 53); // Unknown `tierSizeCalculation` configured
ol.asserts.assert(false, 53); // Unknown `tierSizeCalculation` configured
break;
}