@@ -453,18 +453,18 @@ define([
453
453
var veryCloseY = ( tile . extent . east - tile . extent . west ) / 512.0 ;
454
454
455
455
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 ) {
457
457
++ northwestTileCoordinates . y ;
458
458
}
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 ) {
460
460
++ northwestTileCoordinates . x ;
461
461
}
462
462
463
463
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 ) {
465
465
-- southeastTileCoordinates . y ;
466
466
}
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 ) {
468
468
-- southeastTileCoordinates . x ;
469
469
}
470
470
@@ -486,11 +486,11 @@ define([
486
486
// If this is the northern-most or western-most tile in the imagery tiling scheme,
487
487
// it may not start at the northern or western edge of the terrain tile.
488
488
// Calculate where it does start.
489
- if ( ! this . isBaseLayer ( ) && northwestTileCoordinates . x === 0 ) {
489
+ if ( ! this . isBaseLayer ( ) && Math . abs ( imageryExtent . west - tile . extent . west ) >= veryCloseX ) {
490
490
maxU = Math . min ( 1.0 , ( imageryExtent . west - terrainExtent . west ) / ( terrainExtent . east - terrainExtent . west ) ) ;
491
491
}
492
492
493
- if ( ! this . isBaseLayer ( ) && northwestTileCoordinates . y === 0 ) {
493
+ if ( ! this . isBaseLayer ( ) && Math . abs ( imageryExtent . north - tile . extent . north ) >= veryCloseY ) {
494
494
minV = Math . max ( 0.0 , ( imageryExtent . north - terrainExtent . south ) / ( terrainExtent . north - terrainExtent . south ) ) ;
495
495
}
496
496
@@ -506,7 +506,7 @@ define([
506
506
// and there are more imagery tiles to the east of this one, the maxU
507
507
// should be 1.0 to make sure rounding errors don't make the last
508
508
// 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 ) ) {
510
510
maxU = 1.0 ;
511
511
}
512
512
@@ -522,7 +522,7 @@ define([
522
522
// and there are more imagery tiles to the south of this one, the minV
523
523
// should be 0.0 to make sure rounding errors don't make the last
524
524
// 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 ) ) {
526
526
minV = 0.0 ;
527
527
}
528
528
0 commit comments