Always use source projection loading image tiles

Use the defined source projection despite it being equivalent to the rendering projection to enable using the specified alias code name instead of the code provided by the renderer's projection object. For example: The server only knows the name "EPSG:900913", which is an alias for the equivalent "EPSG:3857", that the renderer uses (by default).
This commit is contained in:
pjeweb
2017-11-08 14:36:46 +01:00
parent 0fceb2f3e3
commit b9313e76f4

View File

@@ -241,7 +241,7 @@ ol.source.TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection
!this.getProjection() || !this.getProjection() ||
!projection || !projection ||
ol.proj.equivalent(this.getProjection(), projection)) { ol.proj.equivalent(this.getProjection(), projection)) {
return this.getTileInternal(z, x, y, pixelRatio, /** @type {!ol.proj.Projection} */ (projection)); return this.getTileInternal(z, x, y, pixelRatio, /** @type {!ol.proj.Projection} */ (this.getProjection() || projection));
} else { } else {
var cache = this.getTileCacheForProjection(projection); var cache = this.getTileCacheForProjection(projection);
var tileCoord = [z, x, y]; var tileCoord = [z, x, y];