It turns out we really want to retile sometimes.

The reason is that we want to avoid moveGriddedTiles to run through hundreds of cycles to shift tiles until we reach the new bounds. But containsBounds does not work if extents that cross the date line start on different worlds, so we use intersectsBounds where we can pass the world bounds to handle this case.
This commit is contained in:
ahocevar
2011-12-07 15:55:22 +01:00
parent 1c9f785998
commit b6df3d871b
2 changed files with 21 additions and 1 deletions

View File

@@ -319,6 +319,18 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
}
} else {
// if the bounds have changed such that they are not even
// *partially* contained by our tiles (e.g. when user has
// programmatically panned to the other side of the earth on
// zoom level 18), then moveGriddedTime could potentially have
// to run through thousands of cycles, so we want to reTile
// instead (thus, partial true).
forceReTile = forceReTile ||
!tilesBounds.intersectsBounds(bounds, {
worldBounds: this.map.baseLayer.wrapDateLine &&
this.map.getMaxExtent()
});
if(resolution !== serverResolution) {
bounds = this.map.calculateBounds(null, serverResolution);
if(forceReTile) {