Skip to content

Commit

Permalink
Merge pull request #7904 from dennisadams/tile-height
Browse files Browse the repository at this point in the history
Fix Undefined Min/Max Height in Inspector
  • Loading branch information
kring authored Jun 10, 2019
2 parents 90b130e + 466c44d commit 3828ad4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Change Log
##### Fixes :wrench:
* 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)
* Fixed a bug where billboards were not pickable when zoomed out completely in 2D View. [#7908](https://github.com/AnalyticalGraphicsInc/cesium/pull/7908)
* 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)

### 1.58.1 - 2018-06-03
_This is an npm-only release to fix a publishing issue_
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Alexander Popiak](https://github.com/apopiak)
* [Trubie Turner](https://github.com/flexei)
* [Merijn Wijngaard](https://github.com/mwijngaard)
* [Dennis Adams](https://github.com/dennisadams)
6 changes: 5 additions & 1 deletion Source/Scene/Globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,11 @@ define([
if (!defined(rayOrigin)) {
// intersection point is outside the ellipsoid, try other value
// minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider
var magnitude = Math.min(defaultValue(tile.data.minimumHeight, 0.0), -11500.0);
var minimumHeight;
if (defined(tile.data.tileBoundingRegion)) {
minimumHeight = tile.data.tileBoundingRegion.minimumHeight;
}
var magnitude = Math.min(defaultValue(minimumHeight, 0.0), -11500.0);

// multiply by the *positive* value of the magnitude
var vectorToMinimumPoint = Cartesian3.multiplyByScalar(surfaceNormal, Math.abs(magnitude) + 1, scratchGetHeightIntersection);
Expand Down
6 changes: 5 additions & 1 deletion Source/Scene/QuadtreePrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,11 @@ define([
if (!defined(rayOrigin)) {
// intersection point is outside the ellipsoid, try other value
// minimum height (-11500.0) for the terrain set, need to get this information from the terrain provider
var magnitude = Math.min(defaultValue(tile.data.minimumHeight, 0.0),-11500.0);
var minimumHeight;
if (defined(tile.data.tileBoundingRegion)) {
minimumHeight = tile.data.tileBoundingRegion.minimumHeight;
}
var magnitude = Math.min(defaultValue(minimumHeight, 0.0), -11500.0);

// multiply by the *positive* value of the magnitude
var vectorToMinimumPoint = Cartesian3.multiplyByScalar(surfaceNormal, Math.abs(magnitude) + 1, scratchPosition);
Expand Down
4 changes: 2 additions & 2 deletions Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,8 @@ define([
this.tileText += '<br>SW corner: ' + newTile.rectangle.west + ', ' + newTile.rectangle.south;
this.tileText += '<br>NE corner: ' + newTile.rectangle.east + ', ' + newTile.rectangle.north;
var data = newTile.data;
if (defined(data)) {
this.tileText += '<br>Min: ' + data.minimumHeight + ' Max: ' + data.maximumHeight;
if (defined(data) && defined(data.tileBoundingRegion)) {
this.tileText += '<br>Min: ' + data.tileBoundingRegion.minimumHeight + ' Max: ' + data.tileBoundingRegion.maximumHeight;
} else {
this.tileText += '<br>(Tile is not loaded)';
}
Expand Down

0 comments on commit 3828ad4

Please sign in to comment.