Add ol.TileCoord

This commit is contained in:
Tom Payne
2012-07-05 14:31:03 +02:00
committed by Tom Payne
parent b4e2e45166
commit 9f0738aa99
4 changed files with 50 additions and 3 deletions
+32
View File
@@ -0,0 +1,32 @@
goog.provide('ol.TileCoord');
goog.require('goog.math.Coordinate');
/**
* @constructor
* @extends {goog.math.Coordinate}
* @param {number} z Z.
* @param {number} x X.
* @param {number} y Y.
*/
ol.TileCoord = function(z, x, y) {
goog.base(this, x, y);
/**
* @type {number}
*/
this.z = z;
};
goog.inherits(ol.TileCoord, goog.math.Coordinate);
/**
* @return {number} Hash.
*/
ol.TileCoord.prototype.hash = function() {
return (this.x << this.z) + this.y;
};