diff --git a/CHANGES.md b/CHANGES.md index 9d43d0950a72..cbd118adda93 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Change Log * Added support for `GroundPrimitive` which works much like `Primitive` but it drapes the geometry over terrain. Valid geometries that can be draped on terrain are `CircleGeometry`, `CorridorGeometry`, `EllipseGeometry`, `PolygonGeometry`, and `RectangleGeometry`. * Added `BoundingSphere.isOccluded` and `OrientedBoundingBox.isOccluded` to determine if the volumes are occluded by an `Occluder`. * Added `distanceSquaredTo` and `computePlaneDistances` functions to `OrientedBoundingBox`. +* Added `reverseZ` tag to `UrlTemplateImageryProvider`. ### 1.12 - 2015-08-03 diff --git a/Source/Scene/UrlTemplateImageryProvider.js b/Source/Scene/UrlTemplateImageryProvider.js index c9c3aac1ab4c..7f78c0e97f5a 100644 --- a/Source/Scene/UrlTemplateImageryProvider.js +++ b/Source/Scene/UrlTemplateImageryProvider.js @@ -62,6 +62,7 @@ define([ *
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • *
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • *
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • + *
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • *
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • *
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • *
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • @@ -201,6 +202,7 @@ define([ *
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • *
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • *
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • + *
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • *
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • *
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • *
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • @@ -598,6 +600,11 @@ define([ return imageryProvider.tilingScheme.getNumberOfYTilesAtLevel(level) - y - 1; } + function reverseZTag(imageryProvider, x, y, level) { + var maximumLevel = imageryProvider.maximumLevel; + return defined(maximumLevel) && level < maximumLevel ? maximumLevel - level - 1 : level; + } + function zTag(imageryProvider, x, y, level) { return level; } @@ -777,6 +784,7 @@ define([ '{s}': sTag, '{reverseX}': reverseXTag, '{reverseY}': reverseYTag, + '{reverseZ}': reverseZTag, '{westDegrees}': westDegreesTag, '{southDegrees}': southDegreesTag, '{eastDegrees}': eastDegreesTag, diff --git a/Specs/Scene/UrlTemplateImageryProviderSpec.js b/Specs/Scene/UrlTemplateImageryProviderSpec.js index b2bc2621d805..8e50aaa6ae09 100644 --- a/Specs/Scene/UrlTemplateImageryProviderSpec.js +++ b/Specs/Scene/UrlTemplateImageryProviderSpec.js @@ -223,17 +223,18 @@ defineSuite([ }); }); - it('evaluation of pattern X Y reverseX reverseY Z', function() { + it('evaluation of pattern X Y reverseX reverseY Z reverseZ', function() { var provider = new UrlTemplateImageryProvider({ - url: 'made/up/tms/server/{z}/{reverseY}/{y}/{reverseX}/{x}.PNG', - tilingScheme: new GeographicTilingScheme() + url: 'made/up/tms/server/{z}/{reverseZ}/{reverseY}/{y}/{reverseX}/{x}.PNG', + tilingScheme: new GeographicTilingScheme(), + maximumLevel: 6 }); return pollToPromise(function() { return provider.ready; }).then(function() { spyOn(loadImage, 'createImage').and.callFake(function(url, crossOrigin, deferred) { - expect(url).toEqual('made/up/tms/server/2/2/1/4/3.PNG'); + expect(url).toEqual('made/up/tms/server/2/3/2/1/4/3.PNG'); // Just return any old image. loadImage.defaultCreateImage('Data/Images/Red16x16.png', crossOrigin, deferred);