Handle tile sources without projection

Such sources should never be reprojected (and no additional tilecache or
tilegrid should be created).
This commit is contained in:
Petr Sloup
2015-06-10 12:37:11 +02:00
parent c205323ff2
commit f2f77091ad
2 changed files with 6 additions and 4 deletions

View File

@@ -129,8 +129,9 @@ ol.source.TileImage.prototype.expireCache = function(projection, usedTiles) {
* @inheritDoc * @inheritDoc
*/ */
ol.source.TileImage.prototype.getTileGridForProjection = function(projection) { ol.source.TileImage.prototype.getTileGridForProjection = function(projection) {
var thisProj = this.getProjection();
if (!goog.isNull(this.tileGrid) && if (!goog.isNull(this.tileGrid) &&
ol.proj.equivalent(this.getProjection(), projection)) { (goog.isNull(thisProj) || ol.proj.equivalent(thisProj, projection))) {
return this.tileGrid; return this.tileGrid;
} else { } else {
var projKey = goog.getUid(projection).toString(); var projKey = goog.getUid(projection).toString();
@@ -147,7 +148,8 @@ ol.source.TileImage.prototype.getTileGridForProjection = function(projection) {
* @inheritDoc * @inheritDoc
*/ */
ol.source.TileImage.prototype.getTileCacheForProjection = function(projection) { ol.source.TileImage.prototype.getTileCacheForProjection = function(projection) {
if (ol.proj.equivalent(this.getProjection(), projection)) { var thisProj = this.getProjection();
if (goog.isNull(thisProj) || ol.proj.equivalent(thisProj, projection)) {
return this.tileCache; return this.tileCache;
} else { } else {
var projKey = goog.getUid(projection).toString(); var projKey = goog.getUid(projection).toString();

View File

@@ -221,8 +221,8 @@ ol.source.Tile.prototype.getTileGridForProjection = function(projection) {
* @protected * @protected
*/ */
ol.source.Tile.prototype.getTileCacheForProjection = function(projection) { ol.source.Tile.prototype.getTileCacheForProjection = function(projection) {
if (goog.isNull(this.tileCache) || var thisProj = this.getProjection();
!ol.proj.equivalent(this.getProjection(), projection)) { if (!goog.isNull(thisProj) && !ol.proj.equivalent(thisProj, projection)) {
return null; return null;
} else { } else {
return this.tileCache; return this.tileCache;