解决轨迹运动二维模式贴地时视角跟随报错的问题
This commit is contained in:
@ -1764,9 +1764,10 @@ class TrajectoryMotion extends Base {
|
|||||||
if (!cartesian3) {
|
if (!cartesian3) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
coordinates = _this.cartesian3Towgs84(cartesian3, viewer);
|
let pos84 = _this.cartesian3Towgs84(cartesian3, viewer);
|
||||||
|
coordinates = [pos84.lng, pos84.lat, pos84.alt + 1.8]
|
||||||
position = cartesian3
|
position = cartesian3
|
||||||
positionCamera = Cesium.Cartesian3.fromDegrees(coordinates.lng, coordinates.lat, coordinates.alt + 1.8)
|
positionCamera = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2])
|
||||||
let positions_smooth = []
|
let positions_smooth = []
|
||||||
for (let i = 0; i <= 1000; i++) {
|
for (let i = 0; i <= 1000; i++) {
|
||||||
if ((i / 1000) > (distance / _this.distance)) {
|
if ((i / 1000) > (distance / _this.distance)) {
|
||||||
@ -1890,7 +1891,7 @@ class TrajectoryMotion extends Base {
|
|||||||
else {
|
else {
|
||||||
if (_this.sdk.viewer.trackedEntity) {
|
if (_this.sdk.viewer.trackedEntity) {
|
||||||
_this.sdk.viewer.camera.setView({
|
_this.sdk.viewer.camera.setView({
|
||||||
destination: Cesium.Cartesian3.fromDegrees(coordinates.lng, coordinates.lat, _this.sdk.viewer.camera.positionCartographic.height),
|
destination: Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], _this.sdk.viewer.camera.positionCartographic.height),
|
||||||
orientation: {
|
orientation: {
|
||||||
heading: Cesium.Math.toRadians(-90),
|
heading: Cesium.Math.toRadians(-90),
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
|
@ -151,7 +151,7 @@ class YJEarth {
|
|||||||
}
|
}
|
||||||
this.options.contextOptions = {
|
this.options.contextOptions = {
|
||||||
webgl: {
|
webgl: {
|
||||||
alpha: true,
|
// alpha: true,
|
||||||
depth: true,
|
depth: true,
|
||||||
stencil: true,
|
stencil: true,
|
||||||
antialias: true,
|
antialias: true,
|
||||||
|
Reference in New Issue
Block a user