Add message to assertions.
This commit is contained in:
@@ -20,7 +20,9 @@ goog.require('ol.tilegrid.TileGrid');
|
||||
ol.tilegrid.WMTS = function(options) {
|
||||
|
||||
goog.asserts.assert(
|
||||
options.resolutions.length == options.matrixIds.length);
|
||||
options.resolutions.length == options.matrixIds.length,
|
||||
'options resolutions and matrixIds must have equal length (%s == %s)',
|
||||
options.resolutions.length, options.matrixIds.length);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -47,7 +49,8 @@ goog.inherits(ol.tilegrid.WMTS, ol.tilegrid.TileGrid);
|
||||
* @return {string} MatrixId..
|
||||
*/
|
||||
ol.tilegrid.WMTS.prototype.getMatrixId = function(z) {
|
||||
goog.asserts.assert(0 <= z && z < this.matrixIds_.length);
|
||||
goog.asserts.assert(0 <= z && z < this.matrixIds_.length,
|
||||
'attempted to retrive matrixId for illegal z (%s)', z);
|
||||
return this.matrixIds_[z];
|
||||
};
|
||||
|
||||
@@ -113,7 +116,9 @@ ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet =
|
||||
metersPerUnit);
|
||||
var tileWidth = elt[tileWidthPropName];
|
||||
var tileHeight = elt[tileHeightPropName];
|
||||
goog.asserts.assert(tileWidth == tileHeight);
|
||||
goog.asserts.assert(tileWidth == tileHeight,
|
||||
'square tiles are assumed, tileWidth (%s) == tileHeight (%s)',
|
||||
tileWidth, tileHeight);
|
||||
tileSizes.push(tileWidth);
|
||||
widths.push(elt['MatrixWidth']);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user