Only load source tiles that intersect the source tile grid's extent

This commit is contained in:
Andreas Hocevar
2017-09-01 11:27:53 +02:00
parent 5f2b729c74
commit 040e67d166
2 changed files with 25 additions and 0 deletions

View File

@@ -94,6 +94,10 @@ ol.VectorImageTile = function(tileCoord, state, src, format, tileLoadFunction,
sourceTileGrid.forEachTileCoord(extent, sourceZ, function(sourceTileCoord) {
var sharedExtent = ol.extent.getIntersection(extent,
sourceTileGrid.getTileCoordExtent(sourceTileCoord));
var sourceExtent = sourceTileGrid.getExtent();
if (sourceExtent) {
sharedExtent = ol.extent.getIntersection(sharedExtent, sourceExtent);
}
if (ol.extent.getWidth(sharedExtent) / resolution >= 0.5 &&
ol.extent.getHeight(sharedExtent) / resolution >= 0.5) {
// only include source tile if overlap is at least 1 pixel