Merge pull request #1036 from twpayne/async-tile-load
Asynchronos tile URL calculation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
goog.provide('ol.TileCoord');
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user