Add ol.TileCoord#getZXY
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
goog.provide('ol.TileCoord');
|
goog.provide('ol.TileCoord');
|
||||||
|
|
||||||
goog.require('goog.array');
|
goog.require('goog.array');
|
||||||
|
goog.require('goog.asserts');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +114,23 @@ ol.TileCoord.getKeyZXY = function(z, x, y) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Array.<number>=} opt_result Optional array to reuse.
|
||||||
|
* @return {Array.<number>} Array of z, x, y.
|
||||||
|
*/
|
||||||
|
ol.TileCoord.prototype.getZXY = function(opt_result) {
|
||||||
|
if (goog.isDef(opt_result)) {
|
||||||
|
goog.asserts.assert(opt_result.length == 3);
|
||||||
|
opt_result[0] = this.z;
|
||||||
|
opt_result[1] = this.x;
|
||||||
|
opt_result[2] = this.y;
|
||||||
|
return opt_result;
|
||||||
|
} else {
|
||||||
|
return [this.z, this.x, this.y];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {number} Hash.
|
* @return {number} Hash.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user