Add ol.source.Tile#getTileGridForProjection

This commit is contained in:
Tom Payne
2014-01-14 17:35:33 +01:00
parent 58fef69fac
commit 68b0f42e3c

View File

@@ -159,6 +159,18 @@ ol.source.Tile.prototype.getTileGrid = function() {
};
/**
* @param {ol.proj.Projection} projection Projection.
* @return {ol.tilegrid.TileGrid} Tile grid.
*/
ol.source.Tile.prototype.getTileGridForProjection = function(projection) {
if (goog.isNull(this.tileGrid)) {
return ol.tilegrid.getForProjection(projection);
} else {
return this.tileGrid;
}
/**
* Marks a tile coord as being used, without triggering a load.
* @param {number} z Tile coordinate z.