Skip to content

Commit a9c31c7

Browse files
author
Tom Fili
authored
Merge pull request #7851 from AnalyticalGraphicsInc/child-tile-mask
Check childTileMask if provider doesn't know tile availability.
2 parents fe914ad + aec9bc3 commit a9c31c7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Change Log
1010

1111
##### Fixes :wrench:
1212
* Fixed an edge case where Cesium would provide ion access token credentials to non-ion servers if the actual asset entrypoint was being hosted by ion. [#7839](https://github.com/AnalyticalGraphicsInc/cesium/pull/7839)
13+
* Fixed a bug that caused Cesium to request non-existent tiles for terrain tilesets lacking tile availability, i.e. a `layer.json` file.
1314

1415
### 1.57 - 2019-05-01
1516

Source/Scene/GlobeSurfaceTile.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,18 @@ define([
350350
};
351351

352352
function prepareNewTile(tile, terrainProvider, imageryLayerCollection) {
353-
if (terrainProvider.getTileDataAvailable(tile.x, tile.y, tile.level) === false) {
353+
var available = terrainProvider.getTileDataAvailable(tile.x, tile.y, tile.level);
354+
355+
if (!defined(available) && defined(tile.parent)) {
356+
// Provider doesn't know if this tile is available. Does the parent tile know?
357+
var parent = tile.parent;
358+
var parentSurfaceTile = parent.data;
359+
if (defined(parentSurfaceTile) && defined(parentSurfaceTile.terrainData)) {
360+
available = parentSurfaceTile.terrainData.isChildAvailable(parent.x, parent.y, tile.x, tile.y);
361+
}
362+
}
363+
364+
if (available === false) {
354365
// This tile is not available, so mark it failed so we start upsampling right away.
355366
tile.data.terrainState = TerrainState.FAILED;
356367
}

0 commit comments

Comments
 (0)