Merge pull request #7206 from ahocevar/vectortile-load-extent

Only load source tiles that intersect the source tile grid's extent
This commit is contained in:
Andreas Hocevar
2017-09-01 12:01:48 +02:00
committed by GitHub
2 changed files with 39 additions and 14 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