From 459f5e4b1b2ee1e3cfde4505f2e066db0fad8276 Mon Sep 17 00:00:00 2001 From: dennisadams Date: Tue, 4 Jun 2019 12:24:11 +0300 Subject: [PATCH 1/3] use tile.data.tileBoundingRegion.minimumHeight instead of tile.data.minimumHeight --- Source/Scene/Globe.js | 6 +++++- Source/Scene/QuadtreePrimitive.js | 6 +++++- Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/Scene/Globe.js b/Source/Scene/Globe.js index c43425389d37..03746c279f45 100644 --- a/Source/Scene/Globe.js +++ b/Source/Scene/Globe.js @@ -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); diff --git a/Source/Scene/QuadtreePrimitive.js b/Source/Scene/QuadtreePrimitive.js index d923303b3313..a892d8d28126 100644 --- a/Source/Scene/QuadtreePrimitive.js +++ b/Source/Scene/QuadtreePrimitive.js @@ -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); diff --git a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js index 61b4cf816392..236f3efee529 100644 --- a/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js +++ b/Source/Widgets/CesiumInspector/CesiumInspectorViewModel.js @@ -883,8 +883,8 @@ define([ this.tileText += '
SW corner: ' + newTile.rectangle.west + ', ' + newTile.rectangle.south; this.tileText += '
NE corner: ' + newTile.rectangle.east + ', ' + newTile.rectangle.north; var data = newTile.data; - if (defined(data)) { - this.tileText += '
Min: ' + data.minimumHeight + ' Max: ' + data.maximumHeight; + if (defined(data) && defined(data.tileBoundingRegion)) { + this.tileText += '
Min: ' + data.tileBoundingRegion.minimumHeight + ' Max: ' + data.tileBoundingRegion.maximumHeight; } else { this.tileText += '
(Tile is not loaded)'; } From b721b76a15890ccdc2f91cc2269b3155a4d250e6 Mon Sep 17 00:00:00 2001 From: dennisadams Date: Tue, 4 Jun 2019 22:33:56 +0300 Subject: [PATCH 2/3] Add name to contributors --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 99ca86db2caa..8e1df7e7dc27 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -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) From 466c44ded2c67e09f51bb41263cfc589f5ac918f Mon Sep 17 00:00:00 2001 From: dennisadams Date: Thu, 6 Jun 2019 22:43:00 +0300 Subject: [PATCH 3/3] update changes.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 6bc56c311746..bf9db68cb7d7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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_