Merge branch 'develop' of http://xny.yj-3d.com:3000/zh/sdk4.0
This commit is contained in:
@ -11,7 +11,7 @@ import LabelObject from '../LabelObject'
|
||||
import MouseEvent from '../../../Event/index'
|
||||
import MouseTip from '../../../MouseTip'
|
||||
import Controller from '../../../Controller/index'
|
||||
import { syncData } from '../../../Global/MultiViewportMode'
|
||||
import { syncData, get3DView } from '../../../Global/MultiViewportMode'
|
||||
import { legp } from '../../Element/datalist'
|
||||
import { getFontList, getFontFamilyName } from '../../Element/fontSelect'
|
||||
import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen'
|
||||
@ -1326,6 +1326,7 @@ class PolylineObject extends Base {
|
||||
}
|
||||
|
||||
static create(that) {
|
||||
|
||||
let ground
|
||||
if (that.heightMode == 2) {
|
||||
ground = true
|
||||
@ -1442,9 +1443,17 @@ class PolylineObject extends Base {
|
||||
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||
repeatX *= groundResolution / cameraHeight / (param.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||
// if (entity.polyline.material.oriRepeat) {
|
||||
let speed = repeatX / entity.polyline.oriRepeat
|
||||
entity.polyline.oriSpeed = speed
|
||||
entity.polyline.oriRepeatX = repeatX
|
||||
|
||||
if (that.sdk.viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
|
||||
let speed = repeatX / entity.polyline.oriRepeat
|
||||
entity.polyline.oriSpeed = speed
|
||||
entity.polyline.oriRepeatX = repeatX
|
||||
} else {
|
||||
let sdk3d = get3DView()
|
||||
let sdk3dEntity = sdk3d.viewer.entities.getById(that.options.id)
|
||||
entity.polyline.oriSpeed = sdk3dEntity.polyline.oriSpeed
|
||||
entity.polyline.oriRepeatX = sdk3dEntity.polyline.oriRepeatX
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1456,8 +1465,21 @@ class PolylineObject extends Base {
|
||||
getSceenLine(entity, options, canvasEle) {
|
||||
let point1 = new Cesium.Cartesian2(0, this.sdk.viewer.canvas.clientHeight)
|
||||
let point2 = new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth / 2, this.sdk.viewer.canvas.clientHeight)
|
||||
var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||
var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||
// var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||
// var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||
|
||||
let ray = this.sdk.viewer.camera.getPickRay(point1);
|
||||
let cartesian1 = this.sdk.viewer.scene.globe.pick(ray, this.sdk.viewer.scene);
|
||||
|
||||
let ray2 = this.sdk.viewer.camera.getPickRay(point2);
|
||||
let cartesian2 = this.sdk.viewer.scene.globe.pick(ray2, this.sdk.viewer.scene);
|
||||
// if (!cartesian1 || !cartesian2) {
|
||||
// let ray = this.sdk.viewer.camera.getPickRay(point1);
|
||||
// cartesian1 = this.sdk.viewer.scene.globe.pick(ray, this.sdk.viewer.scene);
|
||||
|
||||
// let ray2 = this.sdk.viewer.camera.getPickRay(point2);
|
||||
// cartesian2 = this.sdk.viewer.scene.globe.pick(ray2, this.sdk.viewer.scene);
|
||||
// }
|
||||
|
||||
var distance = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||
|
||||
@ -1469,6 +1491,7 @@ class PolylineObject extends Base {
|
||||
500000 // 半径(距离)
|
||||
);
|
||||
|
||||
|
||||
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||
var drawingBufferWidth = this.sdk.viewer.canvas.clientWidth;
|
||||
var drawingBufferHeight = this.sdk.viewer.canvas.clientHeight;
|
||||
@ -1482,7 +1505,14 @@ class PolylineObject extends Base {
|
||||
repeatX = undefined;
|
||||
}
|
||||
|
||||
return repeatX
|
||||
if (this.sdk.viewer.scene.mode === Cesium.SceneMode.SCENE3D) {
|
||||
return repeatX
|
||||
} else {
|
||||
let sdk3d = get3DView()
|
||||
let sdk3dEntity = sdk3d.viewer.entities.getById(this.options.id)
|
||||
return sdk3dEntity.polyline.oriRepeatX
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 编辑框
|
||||
|
Reference in New Issue
Block a user