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