Skip to content

Commit

Permalink
Fix geosolutions-it#9814 Further issue with visibility limits in mast…
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap committed Dec 15, 2023
1 parent bf050d7 commit 71726ee
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions web/client/components/map/cesium/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,7 @@ class CesiumMap extends React.Component {
};

getZoomFromHeight = (height) => {
let distance = height;
// when camera is tilted we could compute the height as the distance between the camera point of view and the viewed point on the map
// the viewed point or target is computed as the intersection of an imaginary vector based on the camera direction (ray) and the globe surface
// if the camera is orthogonal to the globe distance should match the height so this computation is still valid
const target = this.map.scene.globe.pick(new Cesium.Ray(this.map.camera.position, this.map.camera.direction), this.map.scene);
if (target) {
distance = Cesium.Cartesian3.distance(target, this.map.camera.position);
}
return Math.log2(this.props.zoomToHeight / distance) + 1;
return Math.log2(this.props.zoomToHeight / height) + 1;
};

getHeightFromZoom = (zoom) => {
Expand Down

0 comments on commit 71726ee

Please sign in to comment.