Clean up docs and consistently work with resolutions

This commit is contained in:
Andreas Hocevar
2015-03-24 19:03:33 +01:00
parent 4822ca273f
commit ebb40c8046
2 changed files with 18 additions and 11 deletions

View File

@@ -6503,8 +6503,8 @@ olx.tilegrid.TileGridOptions.prototype.origin;
/**
* Origins. If given, the array should match the `resolutions` array, i.e.
* each resolution can have a different origin.
* Origins. If given, the array length should match the length of the
* `resolutions` array, i.e. each resolution can have a different origin.
* @type {Array.<ol.Coordinate>|undefined}
* @api stable
*/
@@ -6512,7 +6512,9 @@ olx.tilegrid.TileGridOptions.prototype.origins;
/**
* Resolutions.
* Resolutions. The array index of each resolution needs to match the zoom
* level. This means that even if a `minZoom` is configured, the resolutions
* array will have a length of `maxZoom + 1`.
* @type {!Array.<number>}
* @api stable
*/
@@ -6528,8 +6530,8 @@ olx.tilegrid.TileGridOptions.prototype.tileSize;
/**
* Tile sizes. If given, the array should match the `resolutions` array, i.e.
* each resolution can have a different tile size.
* Tile sizes. If given, the array length should match the length of the
* `resolutions` array, i.e. each resolution can have a different tile size.
* @type {Array.<number>|undefined}
* @api stable
*/
@@ -6567,7 +6569,8 @@ olx.tilegrid.WMTSOptions.prototype.origin;
/**
* Origins.
* Origins. The length of this array needs to match the length of the
* `resolutions` array.
* @type {Array.<ol.Coordinate>|undefined}
* @api
*/
@@ -6575,7 +6578,9 @@ olx.tilegrid.WMTSOptions.prototype.origins;
/**
* Resolutions.
* Resolutions. The array index of each resolution needs to match the zoom
* level. This means that even if a `minZoom` is configured, the resolutions
* array will have a length of `maxZoom + 1`
* @type {!Array.<number>}
* @api
*/
@@ -6583,7 +6588,8 @@ olx.tilegrid.WMTSOptions.prototype.resolutions;
/**
* matrix IDs.
* matrix IDs. The length of this array needs to match the length of the
* `resolutions` array.
* @type {!Array.<string>}
* @api
*/
@@ -6599,7 +6605,8 @@ olx.tilegrid.WMTSOptions.prototype.tileSize;
/**
* Tile sizes.
* Tile sizes. The length of this array needs to match the length of the
* `resolutions` array.
* @type {Array.<number>|undefined}
* @api
*/

View File

@@ -65,7 +65,7 @@ ol.tilegrid.TileGrid = function(options) {
this.origins_ = null;
if (goog.isDef(options.origins)) {
this.origins_ = options.origins;
goog.asserts.assert(this.origins_.length == this.maxZoom + 1);
goog.asserts.assert(this.origins_.length == this.resolutions_.length);
}
goog.asserts.assert(
(goog.isNull(this.origin_) && !goog.isNull(this.origins_)) ||
@@ -78,7 +78,7 @@ ol.tilegrid.TileGrid = function(options) {
this.tileSizes_ = null;
if (goog.isDef(options.tileSizes)) {
this.tileSizes_ = options.tileSizes;
goog.asserts.assert(this.tileSizes_.length == this.maxZoom + 1);
goog.asserts.assert(this.tileSizes_.length == this.resolutions_.length);
}
/**