Correctly reproject sources in wrappable projection
With extent smaller than the projection extent
This commit is contained in:
@@ -105,15 +105,13 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sourceProj.isGlobal()) {
|
var sourceProjExtent = sourceProj.getExtent();
|
||||||
var sourceProjExtent = sourceProj.getExtent();
|
if (!goog.isNull(sourceProjExtent)) {
|
||||||
if (!goog.isNull(sourceProjExtent)) {
|
if (goog.isNull(maxSourceExtent)) {
|
||||||
if (goog.isNull(maxSourceExtent)) {
|
maxSourceExtent = sourceProjExtent;
|
||||||
maxSourceExtent = sourceProjExtent;
|
} else {
|
||||||
} else {
|
maxSourceExtent = ol.extent.getIntersection(
|
||||||
maxSourceExtent = ol.extent.getIntersection(
|
maxSourceExtent, sourceProjExtent);
|
||||||
maxSourceExtent, sourceProjExtent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +153,7 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
|
|||||||
var srcExtent = this.triangulation_.calculateSourceExtent();
|
var srcExtent = this.triangulation_.calculateSourceExtent();
|
||||||
|
|
||||||
if (!goog.isNull(maxSourceExtent) &&
|
if (!goog.isNull(maxSourceExtent) &&
|
||||||
|
!this.triangulation_.getWrapsXInSource() &&
|
||||||
!ol.extent.intersects(maxSourceExtent, srcExtent)) {
|
!ol.extent.intersects(maxSourceExtent, srcExtent)) {
|
||||||
this.state = ol.TileState.EMPTY;
|
this.state = ol.TileState.EMPTY;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -78,6 +78,16 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent,
|
|||||||
*/
|
*/
|
||||||
this.wrapsXInSource_ = false;
|
this.wrapsXInSource_ = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {boolean}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
this.canWrapXInSource_ = this.sourceProj_.canWrapX() &&
|
||||||
|
!goog.isNull(maxSourceExtent) &&
|
||||||
|
!goog.isNull(this.sourceProj_.getExtent()) &&
|
||||||
|
(ol.extent.getWidth(maxSourceExtent) ==
|
||||||
|
ol.extent.getWidth(this.sourceProj_.getExtent()));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
@@ -195,6 +205,9 @@ ol.reproj.Triangulation.prototype.addQuadIfValid_ = function(a, b, c, d,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wrapsX) {
|
if (wrapsX) {
|
||||||
|
if (!this.canWrapXInSource_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.wrapsXInSource_ = true;
|
this.wrapsXInSource_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user