Merge pull request #1487 from fredj/cleanup

ol.TileCoord: add @struct annotation and use the ol.TileCoord.createOrUpdate function
This commit is contained in:
Frédéric Junod
2014-01-08 04:40:53 -08:00
3 changed files with 3 additions and 16 deletions

View File

@@ -21,6 +21,7 @@ ol.QuadKeyCharCode = {
* @param {number} z Zoom level.
* @param {number} x X.
* @param {number} y Y.
* @struct
*/
ol.TileCoord = function(z, x, y) {

View File

@@ -89,14 +89,7 @@ ol.tilegrid.XYZ.prototype.createTileCoordTransform = function(opt_options) {
return null;
}
}
if (goog.isDef(opt_tileCoord)) {
opt_tileCoord.z = z;
opt_tileCoord.x = x;
opt_tileCoord.y = -y - 1;
return opt_tileCoord;
} else {
return new ol.TileCoord(z, x, -y - 1);
}
return ol.TileCoord.createOrUpdate(z, x, -y - 1, opt_tileCoord);
});
};

View File

@@ -74,13 +74,6 @@ ol.tilegrid.Zoomify.prototype.createTileCoordTransform = function(opt_options) {
return null;
}
}
if (goog.isDef(opt_tileCoord)) {
opt_tileCoord.z = z;
opt_tileCoord.x = x;
opt_tileCoord.y = -y - 1;
return opt_tileCoord;
} else {
return new ol.TileCoord(z, x, -y - 1);
}
return ol.TileCoord.createOrUpdate(z, x, -y - 1, opt_tileCoord);
});
};