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:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user