Skip to content

Commit 3dc911f

Browse files
committedJul 20, 2013
Monkey-merge pull request #970.
1 parent b8e4dd7 commit 3dc911f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎Source/Scene/ImageryLayer.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -453,18 +453,18 @@ define([
453453
var veryCloseY = (tile.extent.east - tile.extent.west) / 512.0;
454454

455455
var northwestTileExtent = imageryTilingScheme.tileXYToExtent(northwestTileCoordinates.x, northwestTileCoordinates.y, imageryLevel);
456-
if (Math.abs(northwestTileExtent.south - extent.north) < veryCloseY && northwestTileCoordinates.y < southeastTileCoordinates.y) {
456+
if (Math.abs(northwestTileExtent.south - tile.extent.north) < veryCloseY && northwestTileCoordinates.y < southeastTileCoordinates.y) {
457457
++northwestTileCoordinates.y;
458458
}
459-
if (Math.abs(northwestTileExtent.east - extent.west) < veryCloseX && northwestTileCoordinates.x < southeastTileCoordinates.x) {
459+
if (Math.abs(northwestTileExtent.east - tile.extent.west) < veryCloseX && northwestTileCoordinates.x < southeastTileCoordinates.x) {
460460
++northwestTileCoordinates.x;
461461
}
462462

463463
var southeastTileExtent = imageryTilingScheme.tileXYToExtent(southeastTileCoordinates.x, southeastTileCoordinates.y, imageryLevel);
464-
if (Math.abs(southeastTileExtent.north - extent.south) < veryCloseY && southeastTileCoordinates.y > northwestTileCoordinates.y) {
464+
if (Math.abs(southeastTileExtent.north - tile.extent.south) < veryCloseY && southeastTileCoordinates.y > northwestTileCoordinates.y) {
465465
--southeastTileCoordinates.y;
466466
}
467-
if (Math.abs(southeastTileExtent.west - extent.east) < veryCloseX && southeastTileCoordinates.x > northwestTileCoordinates.x) {
467+
if (Math.abs(southeastTileExtent.west - tile.extent.east) < veryCloseX && southeastTileCoordinates.x > northwestTileCoordinates.x) {
468468
--southeastTileCoordinates.x;
469469
}
470470

@@ -486,11 +486,11 @@ define([
486486
// If this is the northern-most or western-most tile in the imagery tiling scheme,
487487
// it may not start at the northern or western edge of the terrain tile.
488488
// Calculate where it does start.
489-
if (!this.isBaseLayer() && northwestTileCoordinates.x === 0) {
489+
if (!this.isBaseLayer() && Math.abs(imageryExtent.west - tile.extent.west) >= veryCloseX) {
490490
maxU = Math.min(1.0, (imageryExtent.west - terrainExtent.west) / (terrainExtent.east - terrainExtent.west));
491491
}
492492

493-
if (!this.isBaseLayer() && northwestTileCoordinates.y === 0) {
493+
if (!this.isBaseLayer() && Math.abs(imageryExtent.north - tile.extent.north) >= veryCloseY) {
494494
minV = Math.max(0.0, (imageryExtent.north - terrainExtent.south) / (terrainExtent.north - terrainExtent.south));
495495
}
496496

@@ -506,7 +506,7 @@ define([
506506
// and there are more imagery tiles to the east of this one, the maxU
507507
// should be 1.0 to make sure rounding errors don't make the last
508508
// image fall shy of the edge of the terrain tile.
509-
if (i === southeastTileCoordinates.x && (this.isBaseLayer() || i < imageryMaxX - 1)) {
509+
if (i === southeastTileCoordinates.x && (this.isBaseLayer() || Math.abs(imageryExtent.east - tile.extent.east) < veryCloseX)) {
510510
maxU = 1.0;
511511
}
512512

@@ -522,7 +522,7 @@ define([
522522
// and there are more imagery tiles to the south of this one, the minV
523523
// should be 0.0 to make sure rounding errors don't make the last
524524
// image fall shy of the edge of the terrain tile.
525-
if (j === southeastTileCoordinates.y && (this.isBaseLayer() || j < imageryMaxY - 1)) {
525+
if (j === southeastTileCoordinates.y && (this.isBaseLayer() || Math.abs(imageryExtent.south - tile.extent.south) < veryCloseY)) {
526526
minV = 0.0;
527527
}
528528

0 commit comments

Comments
 (0)