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
*/
ol.source.TileImage.prototype.getTileGridForProjection = function(projection) {
var thisProj = this.getProjection();
if (!goog.isNull(this.tileGrid) &&
ol.proj.equivalent(this.getProjection(), projection)) {
(goog.isNull(thisProj) || ol.proj.equivalent(thisProj, projection))) {
return this.tileGrid;
} else {
var projKey = goog.getUid(projection).toString();
@@ -147,7 +148,8 @@ ol.source.TileImage.prototype.getTileGridForProjection = function(projection) {
* @inheritDoc
*/
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;
} else {
var projKey = goog.getUid(projection).toString();

View File

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