Skip to content

Commit

Permalink
hide the chart layer at the back #55
Browse files Browse the repository at this point in the history
  • Loading branch information
cavencj committed Aug 24, 2021
1 parent 9b4421b commit 069d56f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/chart/extension/CoordinateSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ class CoordinateSystem {
}

dataToPoint(data) {
let scene = this._viewer.scene
let result = [0, 0]
let cartesian3 = Cesium.Cartesian3.fromDegrees(data[0], data[1])
if (!cartesian3) {
return result
}
if (
scene.mode === Cesium.SceneMode.SCENE3D &&
Cesium.Cartesian3.angleBetween(scene.camera.position, cartesian3) >
Cesium.Math.toRadians(80)
) {
return false
let up = Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(
cartesian3,
new Cesium.Cartesian3()
)
let cd = this._viewer.camera.direction
if (Cesium.Cartesian3.dot(up, cd) >= 0) {
return result
}
let coords = scene.cartesianToCanvasCoordinates(cartesian3)
let coords = this._viewer.scene.cartesianToCanvasCoordinates(cartesian3)
if (!coords) {
return result
}
Expand Down

0 comments on commit 069d56f

Please sign in to comment.