From 6e4b282df16d35cde06bbe8ce60f2f48952f8a15 Mon Sep 17 00:00:00 2001 From: Erik Andersson Date: Mon, 31 Oct 2016 10:28:07 +0100 Subject: [PATCH] Fixes #4377 --- Source/Scene/ImageryLayer.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js index 1aa9d3c1aed6..3d0e2640286c 100644 --- a/Source/Scene/ImageryLayer.js +++ b/Source/Scene/ImageryLayer.js @@ -567,6 +567,10 @@ define([ imageryRectangle = imageryTileXYToRectangle(i, northwestTileCoordinates.y, imageryLevel); clippedImageryRectangle = Rectangle.simpleIntersection(imageryRectangle, imageryBounds, clippedRectangleScratch); + if (!defined(clippedImageryRectangle)) { + continue; + } + maxU = Math.min(1.0, (clippedImageryRectangle.east - terrainRectangle.west) / terrainRectangle.width); // If this is the eastern-most imagery tile mapped to this terrain tile, @@ -584,6 +588,11 @@ define([ imageryRectangle = imageryTileXYToRectangle(i, j, imageryLevel); clippedImageryRectangle = Rectangle.simpleIntersection(imageryRectangle, imageryBounds, clippedRectangleScratch); + + if (!defined(clippedImageryRectangle)) { + continue; + } + minV = Math.max(0.0, (clippedImageryRectangle.south - terrainRectangle.south) / terrainRectangle.height); // If this is the southern-most imagery tile mapped to this terrain tile,