Skip to content

Commit 3828ad4

Browse files
authored
Merge pull request #7904 from dennisadams/tile-height
Fix Undefined Min/Max Height in Inspector
2 parents 90b130e + 466c44d commit 3828ad4

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Change Log
66
##### Fixes :wrench:
77
* Fixed a bug that caused missing segments for ground polylines with coplanar points over large distances and problems with polylines containing duplicate points. [#7885](https://github.com/AnalyticalGraphicsInc/cesium//pull/7885)
88
* Fixed a bug where billboards were not pickable when zoomed out completely in 2D View. [#7908](https://github.com/AnalyticalGraphicsInc/cesium/pull/7908)
9+
* Fixed a bug in the inspector where the min/max height values of a picked tile were undefined. [#7904](https://github.com/AnalyticalGraphicsInc/cesium/pull/7904)
910

1011
### 1.58.1 - 2018-06-03
1112
_This is an npm-only release to fix a publishing issue_

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
208208
* [Alexander Popiak](https://github.com/apopiak)
209209
* [Trubie Turner](https://github.com/flexei)
210210
* [Merijn Wijngaard](https://github.com/mwijngaard)
211+
* [Dennis Adams](https://github.com/dennisadams)

Source/Scene/Globe.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,11 @@ define([
675675
if (!defined(rayOrigin)) {
676676
// intersection point is outside the ellipsoid, try other value
677677
// minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider
678-
var magnitude = Math.min(defaultValue(tile.data.minimumHeight, 0.0), -11500.0);
678+
var minimumHeight;
679+
if (defined(tile.data.tileBoundingRegion)) {
680+
minimumHeight = tile.data.tileBoundingRegion.minimumHeight;
681+
}
682+
var magnitude = Math.min(defaultValue(minimumHeight, 0.0), -11500.0);
679683

680684
// multiply by the *positive* value of the magnitude
681685
var vectorToMinimumPoint = Cartesian3.multiplyByScalar(surfaceNormal, Math.abs(magnitude) + 1, scratchGetHeightIntersection);

Source/Scene/QuadtreePrimitive.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,11 @@ define([
11311131
if (!defined(rayOrigin)) {
11321132
// intersection point is outside the ellipsoid, try other value
11331133
// minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider
1134-
var magnitude = Math.min(defaultValue(tile.data.minimumHeight, 0.0),-11500.0);
1134+
var minimumHeight;
1135+
if (defined(tile.data.tileBoundingRegion)) {
1136+
minimumHeight = tile.data.tileBoundingRegion.minimumHeight;
1137+
}
1138+
var magnitude = Math.min(defaultValue(minimumHeight, 0.0), -11500.0);
11351139

11361140
// multiply by the *positive* value of the magnitude
11371141
var vectorToMinimumPoint = Cartesian3.multiplyByScalar(surfaceNormal, Math.abs(magnitude) + 1, scratchPosition);

Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,8 @@ define([
883883
this.tileText += '<br>SW corner: ' + newTile.rectangle.west + ', ' + newTile.rectangle.south;
884884
this.tileText += '<br>NE corner: ' + newTile.rectangle.east + ', ' + newTile.rectangle.north;
885885
var data = newTile.data;
886-
if (defined(data)) {
887-
this.tileText += '<br>Min: ' + data.minimumHeight + ' Max: ' + data.maximumHeight;
886+
if (defined(data) && defined(data.tileBoundingRegion)) {
887+
this.tileText += '<br>Min: ' + data.tileBoundingRegion.minimumHeight + ' Max: ' + data.tileBoundingRegion.maximumHeight;
888888
} else {
889889
this.tileText += '<br>(Tile is not loaded)';
890890
}

0 commit comments

Comments
 (0)