Compare commits
37 Commits
53d2f06918
...
master
Author | SHA1 | Date | |
---|---|---|---|
df2c1735bc | |||
3ae330df3b | |||
7ba25619b7 | |||
ae0dad068b | |||
d1dd920fd2 | |||
a69034a18e | |||
7fc4f14756 | |||
feff8c3a76 | |||
58b8c6a897 | |||
349c91f8df | |||
92ef4a68fd | |||
623a220cbf | |||
e8258d96d0 | |||
d0a682f233 | |||
65441ddff4 | |||
7f3b04eb08 | |||
9289d08f24 | |||
f9a3ffb359 | |||
f5d915bd58 | |||
91cc200917 | |||
0c4c956868 | |||
838f39ba40 | |||
077170f2d4 | |||
a1e33d907d | |||
57a9ccacbd | |||
0eef08ce45 | |||
0f9ad0a0f0 | |||
c6f3138e25 | |||
819166bae0 | |||
159ade36f0 | |||
f8443b7f62 | |||
7feab0786a | |||
5ceaa3b649 | |||
9f216b7257 | |||
4247327bfa | |||
1856bc85e3 | |||
dff3739a0f |
@ -135,6 +135,7 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
||||
pitch: viewer.camera.pitch,
|
||||
roll: viewer.camera.roll
|
||||
}
|
||||
tools.message({text: '操作成功'})
|
||||
})
|
||||
|
||||
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
||||
|
@ -101,6 +101,7 @@ function getFlagFromKeyboard(key) {
|
||||
*/
|
||||
function keyDown(event) {
|
||||
let _viewer = this
|
||||
|
||||
// 判断是否有输入框聚焦
|
||||
function isInputFocused() {
|
||||
const activeElement = document.activeElement;
|
||||
@ -164,32 +165,51 @@ function keyUp(event) {
|
||||
* @return {*}
|
||||
*/
|
||||
function keyboardMapRoamingRender(_viewer) {
|
||||
if(!_viewer.scene.screenSpaceCameraController.enableTilt) {
|
||||
if(!_viewer || !_viewer.scene || !_viewer.scene.screenSpaceCameraController.enableTilt) {
|
||||
return
|
||||
}
|
||||
let camera = _viewer.camera;
|
||||
let ellipsoid = _viewer.scene.globe.ellipsoid;
|
||||
let cameraHeight = ellipsoid.cartesianToCartographic(camera.position).height;
|
||||
let cameraHeight2 = camera.positionCartographic.height;
|
||||
|
||||
|
||||
// 根据相机高度设置移动距离,比默认距离移动效果更好
|
||||
let moveRate = cameraHeight / 20.0;
|
||||
let rotationRate = moveRate / 500000 / Cesium.Math.toDegrees(camera.pitch);
|
||||
let moveRate2 = cameraHeight2 / 100.0;
|
||||
|
||||
if (flags.moveForward) {
|
||||
// camera.moveForward(moveRate);
|
||||
camera.rotate(camera.right, -rotationRate);
|
||||
if(_viewer.scene.mode == 2) {
|
||||
camera.moveUp(moveRate2);
|
||||
}
|
||||
else {
|
||||
camera.rotate(camera.right, -rotationRate);
|
||||
}
|
||||
}
|
||||
if (flags.moveBackward) {
|
||||
// camera.moveBackward(moveRate);
|
||||
camera.rotate(camera.right, rotationRate);
|
||||
if(_viewer.scene.mode == 2) {
|
||||
camera.moveDown(moveRate2);
|
||||
}
|
||||
else {
|
||||
camera.rotate(camera.right, rotationRate);
|
||||
}
|
||||
}
|
||||
if (flags.moveLeft) {
|
||||
// camera.moveLeft(moveRate);
|
||||
camera.rotate(camera.up, -rotationRate);
|
||||
if(_viewer.scene.mode == 2) {
|
||||
camera.moveLeft(moveRate2);
|
||||
}
|
||||
else {
|
||||
camera.rotate(camera.up, -rotationRate);
|
||||
}
|
||||
}
|
||||
if (flags.moveRight) {
|
||||
// camera.moveRight(moveRate);
|
||||
camera.rotate(camera.up, rotationRate);
|
||||
if(_viewer.scene.mode == 2) {
|
||||
camera.moveRight(moveRate2);
|
||||
}
|
||||
else {
|
||||
camera.rotate(camera.up, rotationRate);
|
||||
}
|
||||
}
|
||||
if (flags.moveUp) {
|
||||
camera.moveUp(moveRate);
|
||||
|
@ -157,7 +157,12 @@ async function syncData2(sdk, id, entityId) {
|
||||
if (that.showView == 3) {
|
||||
options.show = false
|
||||
}
|
||||
let newObject = await new that.constructor(sdk2D, options)
|
||||
let callback
|
||||
if(that.type === 'TextBox') {
|
||||
callback = that.callback
|
||||
}
|
||||
|
||||
let newObject = await new that.constructor(sdk2D, options, callback)
|
||||
newObject.onClick = that.onClick
|
||||
newObject.onRightClick = that.onRightClick
|
||||
newObject.onMouseMove = that.onMouseMove
|
||||
@ -252,7 +257,11 @@ async function syncData2(sdk, id, entityId) {
|
||||
if(target) {
|
||||
await target.remove()
|
||||
}
|
||||
target = await new obj.constructor(sdk2D, options)
|
||||
let callback
|
||||
if(obj.type === 'TextBox') {
|
||||
callback = obj.callback
|
||||
}
|
||||
target = await new obj.constructor(sdk2D, options, callback)
|
||||
target.onClick = obj.onClick
|
||||
target.onRightClick = obj.onRightClick
|
||||
target.onMouseMove = obj.onMouseMove
|
||||
|
@ -102,11 +102,20 @@ function off() {
|
||||
let leftCanvas = leftBox.getElementsByTagName('canvas')[0]
|
||||
leftBox.style.width = '100%'
|
||||
leftCanvas.style.width = '100%'
|
||||
let billboardAttributeBoxs = sdkP.viewer._element.getElementsByClassName('billboard-attribute-box')
|
||||
for (let i = 0; i < billboardAttributeBoxs.length; i++) {
|
||||
billboardAttributeBoxs[i].style.display = 'block'
|
||||
}
|
||||
sdkP = null
|
||||
}
|
||||
|
||||
|
||||
async function init(sdk) {
|
||||
let billboardAttributeBoxs = sdk.viewer._element.getElementsByClassName('billboard-attribute-box')
|
||||
for (let i = 0; i < billboardAttributeBoxs.length; i++) {
|
||||
billboardAttributeBoxs[i].style.display = 'none'
|
||||
}
|
||||
|
||||
sdk.entityMap.forEach((item, key) => {
|
||||
if (item.type && item.type == 'TrajectoryMotion' && item.viewFollow) {
|
||||
item.viewFollow = false
|
||||
@ -137,10 +146,8 @@ async function init(sdk) {
|
||||
rightElm.style.position = 'absolute'
|
||||
rightElm.style.right = 'calc(50% - 50px)'
|
||||
|
||||
if (!activeIds || activeIds.length == 0) {
|
||||
leftElm.style.display = 'none'
|
||||
rightElm.style.display = 'none'
|
||||
}
|
||||
leftElm.style.display = 'none'
|
||||
rightElm.style.display = 'none'
|
||||
|
||||
sdk.viewer._element.appendChild(leftElm)
|
||||
sdk.viewer._element.appendChild(rightElm)
|
||||
@ -149,6 +156,12 @@ async function init(sdk) {
|
||||
let right = 0
|
||||
if (activeIds) {
|
||||
for (let i = 0; i < activeIds.length; i++) {
|
||||
let thatP = sdk.entityMap.get(activeIds[i])
|
||||
if (!thatP || (thatP.type === 'terrain' || !thatP.show) || thatP.type === 'TextBox') {
|
||||
continue
|
||||
}
|
||||
leftElm.style.display = 'unset'
|
||||
rightElm.style.display = 'unset'
|
||||
let status = statusMap.get(activeIds[i])
|
||||
if (status) {
|
||||
if (status.P) {
|
||||
@ -911,7 +924,7 @@ async function setSplitDirection(v, id, isoff = false, entityId) {
|
||||
}
|
||||
if (thatP.type === 'GroundSvg' && thatP.text) {
|
||||
thatP.text.show = thatP.textShow
|
||||
target.textShow = false
|
||||
target && (target.textShow = false)
|
||||
}
|
||||
if (thatP.label && thatP.labelShow) {
|
||||
thatP.label.entity.show = true
|
||||
@ -1281,6 +1294,8 @@ function setActiveId(ids = []) {
|
||||
}
|
||||
else {
|
||||
if (leftElm && rightElm) {
|
||||
leftElm.style.display = 'none'
|
||||
rightElm.style.display = 'none'
|
||||
let left = 0
|
||||
let right = 0
|
||||
for (let i = 0; i < activeIds.length; i++) {
|
||||
@ -1298,10 +1313,8 @@ function setActiveId(ids = []) {
|
||||
|
||||
|
||||
let thatP = sdkP.entityMap.get(activeIds[i])
|
||||
let thatD = sdkD.entityMap.get(activeIds[i])
|
||||
if (!thatP || (thatP.type === 'terrain' || !thatP.show)) {
|
||||
leftElm.style.display = 'none'
|
||||
rightElm.style.display = 'none'
|
||||
// let thatD = sdkD.entityMap.get(activeIds[i])
|
||||
if (!thatP || (thatP.type === 'terrain' || !thatP.show) || thatP.type === 'TextBox') {
|
||||
continue
|
||||
}
|
||||
leftElm.style.display = 'unset'
|
||||
|
@ -22,14 +22,53 @@ class AssembleObject extends Base {
|
||||
* @param sdk
|
||||
* @description 集结地
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -22,14 +22,56 @@ class AttackArrowObject extends Base {
|
||||
* @param sdk
|
||||
* @description 箭头面
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.spreadState=false {boolean} 动画
|
||||
* @param options.loop=false {loop} 动画重复
|
||||
* @param options.spreadTime=3000 {number} 动画持续时长(毫秒)
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -17,30 +17,62 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../..
|
||||
class Model extends BaseModel {
|
||||
#timeoutEventObject = null
|
||||
/**
|
||||
* @constructor
|
||||
* @description 加载模型
|
||||
* @param sdk {object} sdk
|
||||
* @param options {object} 模型参数
|
||||
* @param options.id {string} 对象id
|
||||
* @param options.show=true {boolean} 模型显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 资源地址
|
||||
* @param options.position {object} 模型位置
|
||||
* @param options.position.lng {number} 经度
|
||||
* @param options.position.lat {number} 纬度
|
||||
* @param options.position.alt {number} 高度
|
||||
* @param options.scale {object} 比例
|
||||
* @param options.scale.x=1 {number} 比例
|
||||
* @param options.scale.y=1 {number} 比例
|
||||
* @param options.scale.z=1 {number} 比例
|
||||
* @param options.maximumScale=100 {number} 最大比例
|
||||
* @param options.minimumPixelSize=60 {number} 最小像素
|
||||
* @param options.scaleByDistance=true {boolean} 随视野缩放
|
||||
* @param options.rotate {object} 旋转角度
|
||||
* @param options.rotate.x {number} x轴旋转度数
|
||||
* @param options.rotate.y {number} y轴旋转度数
|
||||
* @param options.rotate.z {number} z轴旋转度数
|
||||
* @param options.img {string} 图片地址
|
||||
* @constructor
|
||||
* @description 加载模型
|
||||
* @param sdk {object} sdk
|
||||
* @param options {object} 模型参数
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 模型显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 资源地址
|
||||
* @param options.position {object} 模型位置
|
||||
* @param options.position.lng {number} 经度
|
||||
* @param options.position.lat {number} 纬度
|
||||
* @param options.position.alt {number} 高度
|
||||
* @param options.scale {object} 比例
|
||||
* @param options.scale.x=1 {number} x轴比例
|
||||
* @param options.scale.y=1 {number} y轴比例
|
||||
* @param options.scale.z=1 {number} z轴比例
|
||||
* @param options.maximumScale=100 {number} 最大比例
|
||||
* @param options.minimumPixelSize=60 {number} 最小像素
|
||||
* @param options.scaleByDistance=true {boolean} 随视野缩放
|
||||
* @param options.rotate {object} 旋转角度
|
||||
* @param options.rotate.x {number} x轴旋转度数
|
||||
* @param options.rotate.y {number} y轴旋转度数
|
||||
* @param options.rotate.z {number} z轴旋转度数
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(earth, options = {}, _Dialog = {}) {
|
||||
super(earth, options, _Dialog = {})
|
||||
|
@ -5,6 +5,7 @@ import Dialog from '../../Element/Dialog';
|
||||
import { html } from "./_element";
|
||||
import EventBinding from '../../Element/Dialog/eventBinding';
|
||||
import Base from "../index";
|
||||
import Tools from "../../../Tools";
|
||||
import { syncData } from '../../../Global/MultiViewportMode'
|
||||
import Model from '../BaseSource/BaseModel/Model'
|
||||
import { legp } from '../../Element/datalist'
|
||||
@ -13,7 +14,7 @@ import DrawPolyline from '../../../Draw/drawPolyline'
|
||||
import DrawPolygon from '../../../Draw/drawPolygon'
|
||||
import DrawThreeRect from '../../../Draw/drawThreeRect'
|
||||
import DrawPoint from '../../../Draw/drawPoint'
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global'
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow, CesiumContainer } from '../../../Global/global'
|
||||
|
||||
import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen'
|
||||
|
||||
@ -37,7 +38,7 @@ class BatchModel extends Base {
|
||||
this.options.name = options.name || '批量模型'
|
||||
this.options.type = options.type || '面'
|
||||
this.options.url = options.url || ''
|
||||
this.options.spacing = options.spacing || 50
|
||||
this.options.spacing = options.spacing * 1 || 50
|
||||
this.options.positions = options.positions || []
|
||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||
this.callback = callback
|
||||
@ -46,8 +47,13 @@ class BatchModel extends Base {
|
||||
this._elms = {};
|
||||
this.pointArr = []
|
||||
this.sdk.addIncetance(this.options.id, this)
|
||||
let tools = new Tools(sdk)
|
||||
// BatchModel.computeDis(this)
|
||||
// if (this.options.positions.length > 0 || this.options.positions.lng) {
|
||||
if (this.options.spacing < 0 || options.spacing * 1 === 0) {
|
||||
tools.message({ type: 'warning', text: '请输入正确的间距!' })
|
||||
return;
|
||||
}
|
||||
if ((options.type && options.spacing != undefined) || options.type == '点') {
|
||||
// BatchModel.computeDis(this)
|
||||
|
||||
@ -67,6 +73,32 @@ class BatchModel extends Base {
|
||||
}
|
||||
Draw && Draw.start((a, positions) => {
|
||||
this.options.positions = positions;
|
||||
//判断范围是否过大
|
||||
if (options.type == '面') {
|
||||
let posi = positions.map(v => {
|
||||
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
||||
})
|
||||
let dis1 = Cesium.Cartesian3.distance(posi[0], posi[1])
|
||||
let dis2 = Cesium.Cartesian3.distance(posi[1], posi[2])
|
||||
let num1 = dis1 / this.options.spacing
|
||||
let num2 = dis2 / this.options.spacing
|
||||
if (num1 * num2 > 100) {
|
||||
tools.message({ type: 'warning', text: '数量大于100,请重新绘制' })
|
||||
return;
|
||||
}
|
||||
} else if (options.type == '线') {
|
||||
let posi = positions.map(v => {
|
||||
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
||||
})
|
||||
let dis = 0
|
||||
for (let i = 0; i < posi.length - 2; i++) {
|
||||
dis += Cesium.Cartesian3.distance(posi[i], posi[i + 1])
|
||||
}
|
||||
if (dis / this.options.spacing > 100) {
|
||||
tools.message({ type: 'warning', text: '数量大于100,请重新绘制' })
|
||||
return;
|
||||
}
|
||||
}
|
||||
// this.callback(this.options);
|
||||
(this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this)
|
||||
})
|
||||
|
@ -29,7 +29,8 @@ import MouseTip from '../../../MouseTip'
|
||||
import {
|
||||
setSplitDirection,
|
||||
syncSplitData,
|
||||
setActiveId
|
||||
setActiveId,
|
||||
getState
|
||||
} from '../../../Global/SplitScreen'
|
||||
import {
|
||||
setActiveViewer,
|
||||
@ -47,30 +48,64 @@ class BillboardObject extends Base {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @description 创建点标注
|
||||
* @param sdk {object} sdk
|
||||
* @param options {object} 标注参数
|
||||
* @description 点标注
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param {object} options.positions 位置
|
||||
* @param {number} options.positions.lng 经度
|
||||
* @param {number} options.positions.lat 纬度
|
||||
* @param {number} options.positions.alt 高度
|
||||
* @param options.show=true {boolean} 标注整体的显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param {object} options.position={} 必填,位置
|
||||
* @param {number} options.position.lng 经度
|
||||
* @param {number} options.position.lat 纬度
|
||||
* @param {number} options.position.alt 高度
|
||||
* @param {number} options.heightMode=3 高度模式(0:海拔高度;1:相对地表;2:依附地表; 3:依附模型)
|
||||
* @param [options.scaleByDistance=true] {boolean} 图标是否跟随视角变化进行字段缩放
|
||||
* @param [options.show=true] {boolean} 标注整体的显示/隐藏
|
||||
* @param [options.near=2000] {number} 近端可视距离 scaleByDistance为true时生效
|
||||
* @param [options.far=100000] {number} 远端可视距离 scaleByDistance为true时生效
|
||||
* @param options.billboard {object} 标注中图标的参数
|
||||
* @param [options.billboard.show=true] {boolean} 标注中图标的显示与隐藏
|
||||
* @param [options.scaleByDistance=true] {boolean} 是否开启跟随视野缩放
|
||||
* @param [options.near=2000] {number} 视野缩放最近距离
|
||||
* @param [options.far=100000] {number} 视野缩放最远距离
|
||||
* @param options.billboard {object} 图标参数
|
||||
* @param [options.billboard.show=true] {boolean} 图标显隐
|
||||
* @param options.billboard.image {string} 图标路径
|
||||
* @param options.billboard.defaultImage {string} 默认图标的唯一标识
|
||||
* @param [options.billboard.scale=3] {number} 图标倍数
|
||||
*@param options.label {object} 标注文字的参数
|
||||
*@param [options.label.text] {string} 标注中文字
|
||||
*@param [options.label.show=true] {boolean} 标注文字显示/隐藏
|
||||
*@param [options.label.fontFamily=0] {number} 标注文字字体 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
*@param [options.label.fontSize=39] {number} 标注文字大小 单位px,微软雅黑
|
||||
*@param [options.label.color=#00ffff] {string} 标注文字颜色
|
||||
* @param [options.billboard.scale=3] {number} 图标放大倍数
|
||||
* @param options.label {object} 文字参数
|
||||
* @param [options.label.text] {string} 文字内容
|
||||
* @param [options.label.show=true] {boolean} 文字显隐
|
||||
* @param [options.label.fontFamily=0] {number} 文字字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param [options.label.fontSize=39] {number} 文字大小, 单位px
|
||||
* @param [options.label.color=#00ffff] {string} 文字颜色
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param {object} options.attribute.vr={} 全景图
|
||||
* @param options.attribute.vr.content=[]] {array} 全景图内容
|
||||
* @param options.attribute.vr.content[].name {string} 名称
|
||||
* @param options.attribute.vr.content[].url {string} 地址
|
||||
* @param {object} ptions.attribute.camera={} 摄像头
|
||||
* @param options.attribute.camera.content=[]] {array} 摄像头内容
|
||||
* @param {object} options.attribute.ISC={} ISC
|
||||
* @param options.attribute.ISC.content=[]] {array} ISC内容
|
||||
* @param {object} options.attribute.goods={} 物资
|
||||
* @param options.attribute.goods.content=[]] {array} 物资内容
|
||||
* @param options.attribute.goods.content[].ID {string} ID
|
||||
* @param options.attribute.goods.content[].name {string} 名称
|
||||
* @param options.attribute.goods.content[].cnt {string} 数量
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*@param _Dialog {object} 弹框事件
|
||||
*@param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
*@param _Dialog.instructSubmit(id,name,instruct) {function} 提交指令(ID, 名称,指令内容)
|
||||
@ -197,7 +232,9 @@ class BillboardObject extends Base {
|
||||
|
||||
this.#_destroyMouseEvent = () => {
|
||||
this.attributeElm && (this.attributeElm.style.pointerEvents = 'unset')
|
||||
this.sdk.viewer._element.onmousemove = null
|
||||
if(this.sdk && this.sdk.viewer && this.sdk.viewer._element) {
|
||||
this.sdk.viewer._element.onmousemove = null
|
||||
}
|
||||
document.removeEventListener('mouseup', this.#_destroyMouseEvent)
|
||||
document.removeEventListener('mouseleave', this.#_destroyMouseEvent)
|
||||
}
|
||||
@ -224,6 +261,7 @@ class BillboardObject extends Base {
|
||||
this.attributeElm.style.top = (winpos.y + pixelOffset.y - (this.options.label.show ? (this.options.label.fontSize / 2) : -(this.options.label.fontSize / 2)) - this.attributeElm.offsetHeight - this.options.attributePos.y + height).toFixed(0) + 'px'
|
||||
this.attributeElm.style.width = this.options.attributePos.width + 'px'
|
||||
this.attributeElm.style.height = this.options.attributePos.height + 'px'
|
||||
lineElm.style.zIndex = '-1'
|
||||
if (this.options.attributePos.x < -this.options.attributePos.width / 2) {
|
||||
flag = true
|
||||
lineElm.style.left = 'unset'
|
||||
@ -2602,6 +2640,7 @@ class BillboardObject extends Base {
|
||||
}
|
||||
if (height !== undefined) {
|
||||
this.options.positions.alt = Number(Number(height).toFixed(2))
|
||||
this.#_billboardHeight = this.options.positions.alt
|
||||
this._elms.alt &&
|
||||
this._elms.alt.forEach(item => {
|
||||
item.value = this.options.positions.alt
|
||||
@ -2941,13 +2980,16 @@ class BillboardObject extends Base {
|
||||
attributeElm.style.left = '0px'
|
||||
attributeElm.style.width = 0
|
||||
attributeElm.style.height = 0
|
||||
if(getState()) {
|
||||
attributeElm.style.display = 'none'
|
||||
}
|
||||
// attributeElm.innerHTML = this.options.richTextContent
|
||||
this.sdk.viewer._element.appendChild(attributeElm)
|
||||
let linkHtml = ''
|
||||
let goodsHtml = ''
|
||||
let richTextHtml = ''
|
||||
for (let i = 0; i < this.options.attribute.link.content.length; i++) {
|
||||
linkHtml += `<DIV-cy-tab-pane label="${this.options.attribute.link.content[i].name}"><iframe width='100%' height='100%' src="${this.options.attribute.link.content[i].url}"></iframe></DIV-cy-tab-pane>`
|
||||
linkHtml += `<DIV-cy-tab-pane label="${this.options.attribute.link.content[i].name}"><iframe width='100%' height='100%' src="${this.options.attribute.link.content[i].url}" ></iframe></DIV-cy-tab-pane>`
|
||||
}
|
||||
if (this.options.attribute.goods && this.options.attribute.goods.content && this.options.attribute.goods.content.length > 0) {
|
||||
goodsHtml += `<DIV-cy-tab-pane label="物资">
|
||||
@ -2982,7 +3024,7 @@ class BillboardObject extends Base {
|
||||
`
|
||||
|
||||
if (!linkHtml && !goodsHtml && !richTextHtml) {
|
||||
boxHtml = boxHtml + '<p style="margin: 0;width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;">暂无属性信息</p><div class="billboard-attribute-box-line"></div>'
|
||||
boxHtml = boxHtml + '<p style="margin: 0;width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;backdrop-filter: blur(2px);">暂无属性信息</p><div class="billboard-attribute-box-line"></div>'
|
||||
}
|
||||
else {
|
||||
boxHtml = boxHtml + `
|
||||
|
@ -21,23 +21,53 @@ class CircleDiffuse extends Base {
|
||||
* @param sdk
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param [options.show=true] {boolean} 显示/隐藏
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.lng {number} 经度
|
||||
* @param options.lat {number} 维度
|
||||
* @param options.color=#1FA8E3 {string} 基础颜色
|
||||
* @param options.colors=[] {string} 范围颜色
|
||||
* @param options.speed=5 {number} 速度
|
||||
* @param options.count=3 {number} 波纹数量
|
||||
* @param options.circle=[{radius, color}] {object} 圆属性;radius:半径,color:颜色
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.circle=[]] {array} 圆属性
|
||||
* @param options.circle[].radius {number} 半径
|
||||
* @param options.circle[].color {string} 颜色
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
this.options.lng = options.lng
|
||||
this.options.lat = options.lat
|
||||
this.options.color = options.color || '#1FA8E3'
|
||||
this.options.colors = options.colors || []
|
||||
this.options.transparency = (options.transparency || options.transparency === 0) ? options.transparency : 1
|
||||
if (this.options.transparency > 1) {
|
||||
this.options.transparency = 1
|
||||
@ -181,7 +211,7 @@ class CircleDiffuse extends Base {
|
||||
}
|
||||
that.sdk._entityZIndex++
|
||||
if (that.sdk.viewer._element.className === 'cesium-viewer 2d') {
|
||||
that.entity.ellipse.height = 1000000
|
||||
that.entity.ellipse.height = 1
|
||||
}
|
||||
CircleDiffuse.createLabel(that)
|
||||
syncData(that.sdk, that.options.id)
|
||||
@ -430,15 +460,6 @@ class CircleDiffuse extends Base {
|
||||
})
|
||||
}
|
||||
|
||||
get colors() {
|
||||
return this.options.colors
|
||||
}
|
||||
|
||||
set colors(v) {
|
||||
this.options.colors = v
|
||||
CircleDiffuse.create(this)
|
||||
}
|
||||
|
||||
get labelShow() {
|
||||
return this.options.label.show
|
||||
}
|
||||
|
@ -18,22 +18,63 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Gl
|
||||
class CircleObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 创建圆
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.center {object} 位置
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 纬度
|
||||
* @param options.center.alt {object} 高度
|
||||
* @param options.radius=10 {object}半径
|
||||
* @param options.center {object} 中心位置
|
||||
* @param options.center.lng {number} 经度
|
||||
* @param options.center.lat {number} 纬度
|
||||
* @param options.center.alt {number} 高度
|
||||
* @param options.radius=10 {number}半径
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.width=3 {number} 边框宽
|
||||
* @param options.line.color="#ff000080" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -21,30 +21,57 @@ class CurvelineObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 折线
|
||||
* @description 曲线
|
||||
* @param options {object} 线属性
|
||||
* @param options.name{string} 名称
|
||||
* @param options.width=3{number} 线宽
|
||||
* @param options.color=#ff0000 {string} 颜色
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
|
||||
* @param options.heightMode{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光...
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options.extend=false {boolean} 线缓冲
|
||||
* @param options['extend-width']=10 {number} 线缓冲宽度
|
||||
* @param options['extend-color']=#ffde00 {number} 线缓冲颜色
|
||||
* @param options.extendWidth=10 {number} 线缓冲宽度
|
||||
* @param options.extendColor=rgba(255,255,80,0.3) {number} 线缓冲颜色
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...]
|
||||
* @param options.label {object} 标注
|
||||
* @param options.label.show=false {boolean} 标注显隐
|
||||
* @param options.label.fontSize=20 {number} 标注字体大小
|
||||
* @param options.label.color=#ffffff {string} 标注字体颜色
|
||||
* @param options.label.lineWidth=1 {number} 标注引线宽
|
||||
* @param options.label.pixelOffset=20 {string} 标注引线长度
|
||||
* @param options.label.backgroundColor=['#42c6ef', '#42c6ef'] {Array} 标注背景
|
||||
* @param options.label.lineColor=#fff000 {string} 标注引线颜色
|
||||
* @param options.label.scaleByDistance=false {boolean} 标注是否随视野缩放
|
||||
* @param options.label.near=2000 {boolean} 标注随视野缩放最近距离
|
||||
* @param options.label.far=100000 {boolean} 标注随视野缩放最远距离
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {string} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*
|
||||
*
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
@ -1384,10 +1411,10 @@ class CurvelineObject extends Base {
|
||||
that.options.lengthByMeter = res
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
})
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
|
||||
// if (this.options['nose-to-tail']) {
|
||||
// let array = []
|
||||
|
@ -18,12 +18,13 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Gl
|
||||
class EllipseObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 创建椭圆
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.center {object} 位置
|
||||
* @param options.center {object} 中心位置
|
||||
* @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 维度
|
||||
@ -33,8 +34,41 @@ class EllipseObject extends Base {
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(255, 0, 0, 1)" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -13,6 +13,15 @@ class Explosion extends Base {
|
||||
* @description 爆炸
|
||||
* @param sdk
|
||||
* @param options {object} 爆炸属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param {object} options.position={} 位置
|
||||
* @param {number} options.position.lng 经度
|
||||
* @param {number} options.position.lat 纬度
|
||||
* @param {number} options.position.alt 高度
|
||||
* @param options.scaleByDistance=true {boolean} 是否开启跟随视野缩放
|
||||
* @param options.size=80 {number} 大小(爆炸范围)
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -9,6 +9,25 @@ import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Glo
|
||||
|
||||
class FlyRoam extends Base {
|
||||
#clickHandler = undefined
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 飞行漫游
|
||||
* @param options {object}
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.repeat=0 {number} 重复次数
|
||||
* @param options.points=[]] {array} 视点列表
|
||||
* @param options.points[].position {object} 视点位置
|
||||
* @param options.points[].position.lng {number} 经度
|
||||
* @param options.points[].position.lat {number} 纬度
|
||||
* @param options.points[].position.alt {number} 高度
|
||||
* @param options.points[].orientation {object} 视点方向
|
||||
* @param options.points[].orientation.heading=0 {number} 视点航向角
|
||||
* @param options.points[].orientation.pitch=0 {number} 视点俯仰角
|
||||
* @param options.points[].orientation.roll=0 {number} 视点翻滚角
|
||||
* @param options.points[].duration=0 {number} 持续时间
|
||||
**/
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options)
|
||||
this.options.id = options.id || this.randomString()
|
||||
@ -162,6 +181,7 @@ class FlyRoam extends Base {
|
||||
pitch: viewer.camera.pitch,
|
||||
roll: viewer.camera.roll
|
||||
}
|
||||
this.message({text: '操作成功'})
|
||||
})
|
||||
|
||||
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
||||
|
@ -26,7 +26,7 @@ class GroundSvg extends Base {
|
||||
* @param options.scale {object} 比例
|
||||
* @param options.scale.x=1 {number} x轴比例
|
||||
* @param options.scale.y=1 {number} y轴比例
|
||||
* @param options.url {string} svg图片地址
|
||||
* @param options.url {string} 资源地址
|
||||
* @param options.flipe {object} 翻转
|
||||
* @param options.flipe.x=false {boolean} 绕X轴翻转
|
||||
* @param options.flipe.y=false {boolean} 绕Y轴翻转
|
||||
@ -34,8 +34,31 @@ class GroundSvg extends Base {
|
||||
* @param options.position.lng {number} 经度
|
||||
* @param options.position.lat {number} 纬度
|
||||
* @param options.color {string} 颜色
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.text {object} 文字
|
||||
* @param options.text.show=true {boolean} 文字
|
||||
* @param options.text.position.lng {number} 经度
|
||||
* @param options.text.position.lat {number} 纬度
|
||||
* @param options.text.position.alt {number} 高度
|
||||
* @param options.text.fontSize=20 {number} 字体大小
|
||||
* @param options.text.color=#ffffff {string} 字体大小
|
||||
* @param options.text.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.text.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.text.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
#loadEvent = void 0
|
||||
#loaded = false
|
||||
@ -376,7 +399,10 @@ class GroundSvg extends Base {
|
||||
}
|
||||
set textFontSize(v) {
|
||||
this.options.text.fontSize = v
|
||||
this.text && (this.text.fontSize = v)
|
||||
if(this.text) {
|
||||
this.text.fontSize = v
|
||||
this.text.pixelOffset = v
|
||||
}
|
||||
this._elms.textFontSize && this._elms.textFontSize.forEach((item) => {
|
||||
item.value = v
|
||||
})
|
||||
@ -909,11 +935,10 @@ class GroundSvg extends Base {
|
||||
text: that.options.text.value,
|
||||
fontSize: that.options.text.fontSize,
|
||||
color: that.options.text.color,
|
||||
pixelOffset: that.options.text.pixelOffset,
|
||||
pixelOffset: that.options.text.fontSize,
|
||||
backgroundColor: that.options.text.backgroundColor,
|
||||
lineColor: that.options.text.lineColor,
|
||||
lineWidth: that.options.text.lineWidth,
|
||||
pixelOffset: 0,
|
||||
lineColor: '#ffffff00',
|
||||
lineWidth: 0,
|
||||
scaleByDistance: that.options.text.scaleByDistance,
|
||||
backgroundColor: ['#ffffff00', '#ffffff00'],
|
||||
near: that.options.text.near,
|
||||
@ -1335,8 +1360,8 @@ class GroundSvg extends Base {
|
||||
w = (Math.cos(radiansW) * distance) * 2
|
||||
h = (Math.cos(radiansH) * distance) * 2
|
||||
// scaleY值
|
||||
this.scale.x = w / 3.5
|
||||
this.scale.y = h / 3.5
|
||||
this.scale.x = Math.abs(w) / 3.5
|
||||
this.scale.y = Math.abs(h) / 3.5
|
||||
break
|
||||
case 'svg-control-points_2':
|
||||
case 'svg-control-points_8':
|
||||
@ -1407,8 +1432,8 @@ class GroundSvg extends Base {
|
||||
w = (Math.cos(radiansW) * distance) * 2
|
||||
h = (Math.cos(radiansH) * distance) * 2
|
||||
// scaleY值
|
||||
this.scale.x = w / 3.5
|
||||
this.scale.y = h / 3.5
|
||||
this.scale.x = Math.abs(w) / 3.5
|
||||
this.scale.y = Math.abs(h) / 3.5
|
||||
break
|
||||
case 'svg-control-points_4':
|
||||
bearingW = (((turf.rhumbBearing(pointC, turf.point(controlPoints[4])) + 360) - this.angle) % 360)
|
||||
|
@ -18,9 +18,10 @@ class Flame extends Base {
|
||||
* @description 火焰特效
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.startColor="#ff0000" {string} 起始颜色
|
||||
* @param options.endColor="#fff000" {string} 结束颜色
|
||||
* @param options.startScale=0.5 {number} 初始比例
|
||||
@ -34,8 +35,15 @@ class Flame extends Base {
|
||||
* @param options.lng 经度
|
||||
* @param options.lat 纬度
|
||||
* @param options.alt 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -17,9 +17,10 @@ class Fountain extends Base {
|
||||
* @description 喷泉特效
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.startColor="#c1f7f24d" {string} 起始颜色
|
||||
* @param options.endColor="#ffffff00" {string} 结束颜色
|
||||
* @param options.startScale=1 {number} 初始比例
|
||||
@ -30,12 +31,18 @@ class Fountain extends Base {
|
||||
* @param options.maximumParticleLife=7 {number} 最大存在时间(秒)
|
||||
* @param options.emissionRate=20 {number} 发射速率(个/每秒)
|
||||
* @param options.particleSize=0.5{number} 粒子尺大小
|
||||
* @param options.gravity=-3.5{number} 重力值
|
||||
* @param options.lng 经度
|
||||
* @param options.lat 纬度
|
||||
* @param options.alt 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
@ -50,7 +57,7 @@ class Fountain extends Base {
|
||||
this.options.maximumSpeed = options.maximumSpeed || 9.5
|
||||
this.options.emissionRate = options.emissionRate || 20
|
||||
this.options.particleSize = options.particleSize || 0.5
|
||||
this.options.gravity = (options.gravity || options.gravity === 0) ? options.gravity : -3.5
|
||||
// this.options.gravity = (options.gravity || options.gravity === 0) ? options.gravity : -3.5
|
||||
this.options.show = options.show === false ? false : true
|
||||
this._elms = {};
|
||||
this.positionCallBack = null
|
||||
|
@ -17,9 +17,10 @@ class Smoke extends Base {
|
||||
* @description 烟雾特效
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.startColor="#00000000" {string} 起始颜色
|
||||
* @param options.endColor="#0000001a" {string} 结束颜色
|
||||
* @param options.startScale=0.1 {number} 初始比例
|
||||
@ -33,8 +34,15 @@ class Smoke extends Base {
|
||||
* @param options.lng 经度
|
||||
* @param options.lat 纬度
|
||||
* @param options.alt 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -16,9 +16,10 @@ class Spout extends Base {
|
||||
* @description 水柱
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.startColor="#c1f7f2" {string} 起始颜色
|
||||
* @param options.endColor="#ffffff00" {string} 结束颜色
|
||||
* @param options.startScale=0.2 {number} 初始比例
|
||||
@ -28,8 +29,8 @@ class Spout extends Base {
|
||||
* @param options.maximumParticleLife=12 {number} 最大存在时间(秒)
|
||||
* @param options.emissionRate=100 {number} 发射速率(个/每秒)
|
||||
* @param options.particleSize=1 {number} 粒子尺大小
|
||||
* @param options.heading 朝向
|
||||
* @param options.pitch 俯仰角度
|
||||
* @param options.heading 航向角
|
||||
* @param options.pitch 俯仰角
|
||||
* @param options.start {object} 开始位置
|
||||
* @param options.start.lng 经度
|
||||
* @param options.start.lat 纬度
|
||||
@ -38,8 +39,15 @@ class Spout extends Base {
|
||||
* @param options.end.lng 经度
|
||||
* @param options.end.lat 纬度
|
||||
* @param options.end.alt 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -22,14 +22,56 @@ class PincerArrowObject extends Base {
|
||||
* @param sdk
|
||||
* @description 双箭头
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.spreadState=false {boolean} 动画
|
||||
* @param options.loop=false {loop} 动画重复
|
||||
* @param options.spreadTime=3000 {number} 动画持续时长(毫秒)
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -19,8 +19,8 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Gl
|
||||
class PolygonObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 多边形
|
||||
* @param sdk
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
@ -28,11 +28,51 @@ class PolygonObject extends Base {
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*
|
||||
|
||||
|
||||
*
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
|
@ -26,9 +26,44 @@ class PolyhedronObject extends Base {
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#ff0000" {string} 颜色
|
||||
* @param options.height=10 {number} 高
|
||||
* @param {Array.<object>} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.areaUnit='平方米' {string} 投影面积单位
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -25,28 +25,46 @@ class PolylineObject extends Base {
|
||||
* @description 折线
|
||||
* @param options {object} 线属性
|
||||
* @param options.name{string} 名称
|
||||
* @param options.width * @param options.width=3{number} 线宽
|
||||
* @param options.width=3{number} 线宽
|
||||
* @param options.color=#ff0000 {string} 颜色
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光...
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options.smooth=false {boolean} 线段圆滑
|
||||
* @param options.extend=false {boolean} 线缓冲
|
||||
* @param options['extend-width']=10 {number} 线缓冲宽度
|
||||
* @param options['extend-color']=rgba(255,255,80,0.3) {number} 线缓冲颜色
|
||||
* @param options.extendWidth=10 {number} 线缓冲宽度
|
||||
* @param options.extendColor=rgba(255,255,80,0.3) {number} 线缓冲颜色
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...]
|
||||
* @param options.label {object} 标注
|
||||
* @param options.label.show=false {boolean} 标注显隐
|
||||
* @param options.label.fontSize=20 {number} 标注字体大小
|
||||
* @param options.label.color=#ffffff {string} 标注字体颜色
|
||||
* @param options.label.lineWidth=1 {number} 标注引线宽
|
||||
* @param options.label.pixelOffset=20 {string} 标注引线长度
|
||||
* @param options.label.backgroundColor=['#42c6ef', '#42c6ef'] {Array} 标注背景
|
||||
* @param options.label.lineColor=#fff000 {string} 标注引线颜色
|
||||
* @param options.label.scaleByDistance=false {boolean} 标注是否随视野缩放
|
||||
* @param options.label.near=2000 {boolean} 标注随视野缩放最近距离
|
||||
* @param options.label.far=100000 {boolean} 标注随视野缩放最远距离
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {string} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
*
|
||||
*
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
@ -1410,10 +1428,10 @@ class PolylineObject extends Base {
|
||||
that.options.lengthByMeter = res
|
||||
that.lengthUnit = that.options['length-unit']
|
||||
syncData(that.sdk, that.options.id)
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
})
|
||||
if (that.options.show) {
|
||||
setSplitDirection(0, that.options.id)
|
||||
}
|
||||
|
||||
|
||||
// if (this.options['nose-to-tail']) {
|
||||
|
@ -20,14 +20,44 @@ class RadarScan extends Base {
|
||||
* @param sdk
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param [options.show=true] {boolean} 显示/隐藏
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.lng {number} 经度
|
||||
* @param options.lat {number} 维度
|
||||
* @param options.color=#1FA8E3 {string} 颜色
|
||||
* @param options.color=#FFEB3B {string} 颜色
|
||||
* @param options.radius=10 {number} 半径
|
||||
* @param options.speed=20 {number} 速度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
@ -138,7 +168,7 @@ class RadarScan extends Base {
|
||||
})
|
||||
that.sdk._entityZIndex++
|
||||
if (that.sdk.viewer._element.className === 'cesium-viewer 2d') {
|
||||
that.entity.ellipse.height = 1000000
|
||||
that.entity.ellipse.height = 1
|
||||
}
|
||||
RadarScan.createLabel(that)
|
||||
syncData(that.sdk, that.options.id)
|
||||
|
@ -23,16 +23,46 @@ class RadarScanStereoscopic extends Base {
|
||||
* @param sdk
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param [options.show=true] {boolean} 显示/隐藏
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.lng {number} 经度
|
||||
* @param options.lat {number} 纬度
|
||||
* @param options.alt {number} 高度
|
||||
* @param options.colorOut=#ff0000 {string} 范围颜色
|
||||
* @param options.colorIn=#ff0000 {string} 扫描颜色
|
||||
* @param options.colorOut=rgba(255,255,0,0.3){string} 范围颜色
|
||||
* @param options.colorIn=rgba(255,0,0,0.3){string} 扫描颜色
|
||||
* @param options.radius=10 {number} 半径
|
||||
* @param options.duration=2000 {number} 持续时间
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -19,22 +19,56 @@ class SectorObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @description 创建扇形
|
||||
* @param sdk
|
||||
* @param options {object} 扇形属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色
|
||||
* @param options.center {object} 位置
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 维度
|
||||
* @param options.center.lng {number} 经度
|
||||
* @param options.center.lat {number} 纬度
|
||||
* @param options.center.alt {number} 高度
|
||||
* @param options.radius=10 {number} 半径
|
||||
* @param options.startAngle=10 {number} 起始方向
|
||||
* @param options.endAngle=0 {number} 结束方向
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=3 {string} 边框宽
|
||||
* @param options.line.width=3 {number} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -22,14 +22,56 @@ class StraightArrowObject extends Base {
|
||||
* @param sdk
|
||||
* @description 直线箭头
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.spreadState=false {boolean} 动画
|
||||
* @param options.loop=false {loop} 动画重复
|
||||
* @param options.spreadTime=3000 {number} 动画持续时长(毫秒)
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -2,6 +2,7 @@
|
||||
* 文本框
|
||||
*/
|
||||
import Base from "../index";
|
||||
import { syncData, getSdk } from '../../../Global/MultiViewportMode'
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global'
|
||||
class TextBox extends Base {
|
||||
/**
|
||||
@ -29,7 +30,15 @@ class TextBox extends Base {
|
||||
this.textDom = undefined
|
||||
this.create(this)
|
||||
this.sdk.addIncetance(this.options.id, this)
|
||||
|
||||
this.callback = callback
|
||||
|
||||
// syncData(this.sdk, this.options.id)
|
||||
|
||||
}
|
||||
|
||||
get type() {
|
||||
return 'TextBox'
|
||||
}
|
||||
|
||||
async create(that) {
|
||||
@ -38,6 +47,7 @@ class TextBox extends Base {
|
||||
let dom = document.createElement('span');
|
||||
dom.id = that.options.id
|
||||
dom.className = 'popup-textarea'
|
||||
dom.style.zIndex = 1
|
||||
// 创建textarea元素
|
||||
var textarea = document.createElement('textarea');
|
||||
textarea.className = 'textarea'
|
||||
@ -53,8 +63,7 @@ class TextBox extends Base {
|
||||
|
||||
// 配置CSS样式和内容结构
|
||||
viewer.cesiumWidget.container.appendChild(dom);
|
||||
let posi = Cesium.Cartesian3.fromDegrees(that.options.position.lng.toFixed(4), that.options.position.lat.toFixed(4), that.options.position.alt.toFixed(4))
|
||||
|
||||
let posi = Cesium.Cartesian3.fromDegrees(that.options.position.lng, that.options.position.lat, that.options.position.alt)
|
||||
that.handler = function () {
|
||||
const position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
|
||||
viewer.scene, posi
|
||||
@ -70,22 +79,44 @@ class TextBox extends Base {
|
||||
that.textDom = dom;
|
||||
|
||||
}
|
||||
async isClick(posi, id) {
|
||||
let params = [
|
||||
{
|
||||
position: posi
|
||||
},
|
||||
id,
|
||||
null
|
||||
]
|
||||
|
||||
this.clickCallBack({ position: posi }, id, null)
|
||||
}
|
||||
async setHandeler(data) {
|
||||
let that = this
|
||||
const ray = this.sdk.viewer.camera.getPickRay(new Cesium.Cartesian2(data.x, data.y));
|
||||
var cartesian = this.sdk.viewer.scene.globe.pick(ray, this.sdk.viewer.scene);
|
||||
|
||||
let cartesian = this.sdk.viewer.scene.pickPosition(new Cesium.Cartesian2(data.x, data.y)); //屏幕坐标转为笛卡尔空间坐标
|
||||
// if (!cartesian) return;
|
||||
|
||||
// let c = Cesium.Cartographic.fromCartesian(position);
|
||||
if (!cartesian) {
|
||||
const ray = this.sdk.viewer.camera.getPickRay(new Cesium.Cartesian2(data.x, data.y));
|
||||
cartesian = this.sdk.viewer.scene.globe.pick(ray, this.sdk.viewer.scene);
|
||||
}
|
||||
|
||||
if (Cesium.defined(cartesian)) {
|
||||
that.sdk.viewer.scene.postRender.removeEventListener(that.handler);
|
||||
|
||||
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
|
||||
var longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
||||
var latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
||||
|
||||
let height = await that.getClampToHeight({ lng: longitude, lat: latitude })
|
||||
that.position = {
|
||||
lng: longitude,
|
||||
lat: latitude,
|
||||
alt: cartographic.height
|
||||
// alt: height
|
||||
}
|
||||
let posi = Cesium.Cartesian3.fromDegrees(longitude.toFixed(4), latitude.toFixed(4), cartographic.height.toFixed(4))
|
||||
let posi = Cesium.Cartesian3.fromDegrees(longitude, latitude, cartographic.height)
|
||||
|
||||
that.handler = function () {
|
||||
const position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
|
||||
@ -104,16 +135,63 @@ class TextBox extends Base {
|
||||
async getwords(words) {
|
||||
this.options.text = words
|
||||
this.callback(this.options)
|
||||
let { sdkP } = getSdk()
|
||||
if (this.sdk === sdkP && sdkP) {//三维
|
||||
syncData(this.sdk, this.options.id)
|
||||
}
|
||||
else if (sdkP) {//二维
|
||||
sdkP.entityMap.get(this.options.id).text = words
|
||||
sdkP.entityMap.get(this.options.id).twoToThree(this.options.position)
|
||||
} else if (!sdkP) {
|
||||
syncData(this.sdk, this.options.id)
|
||||
}
|
||||
}
|
||||
async twoToThree(position) {
|
||||
let that = this
|
||||
that.sdk.viewer.scene.postRender.removeEventListener(that.handler);
|
||||
let posi = Cesium.Cartesian3.fromDegrees(position.lng, position.lat, position.alt)
|
||||
|
||||
that.handler = function () {
|
||||
const position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
|
||||
that.sdk.viewer.scene, posi
|
||||
);
|
||||
if (position) {
|
||||
let width = that.textDom.clientWidth * 1
|
||||
let height = that.textDom.clientHeight * 1
|
||||
that.textDom.style.left = `${position.x - width / 2}px`;
|
||||
that.textDom.style.top = `${position.y - height}px`;
|
||||
}
|
||||
}
|
||||
that.sdk.viewer.scene.postRender.addEventListener(that.handler);
|
||||
}
|
||||
async returnFun() {
|
||||
return this.handler
|
||||
}
|
||||
get text() {
|
||||
return this.options.text
|
||||
}
|
||||
set text(val) {
|
||||
this.options.text = val
|
||||
this.textDom.querySelector('textarea').value = val
|
||||
this.callback(this.options)
|
||||
}
|
||||
get onClick() {
|
||||
return this.clickCallBack
|
||||
}
|
||||
set onClick(val) {
|
||||
if (val && typeof val !== 'function') {
|
||||
console.error('val:', val, '不是一个function')
|
||||
} else {
|
||||
this.clickCallBack = val
|
||||
}
|
||||
}
|
||||
get show() {
|
||||
return this.options.show
|
||||
}
|
||||
set show(v) {
|
||||
this.options.show = v
|
||||
this.textDom && (this.textDom.style.display = v ? 'block' : 'none');
|
||||
syncData(this.sdk, this.options.id)
|
||||
}
|
||||
get position() {
|
||||
return this.options.position
|
||||
@ -204,6 +282,7 @@ class TextBox extends Base {
|
||||
if (this.textDom && this.textDom.parentNode) {
|
||||
this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom);
|
||||
}
|
||||
await this.sdk.removeIncetance(this.options.id)
|
||||
}
|
||||
|
||||
flicker() { }
|
||||
|
@ -14,14 +14,27 @@ class GroundText extends Base {
|
||||
* @param sdk
|
||||
* @description 贴地文字
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.text {string} 文字
|
||||
* @param options.angle=0 {number} 旋转角度
|
||||
* @param options.scale=1 {number} 比例
|
||||
* @param {object} options.position 经纬度{lon,lat}
|
||||
* @param {object} options.positions 经纬度集[{lon,lat}]仅在未定义 position 时有效
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.scale=1 {number} 缩放比例
|
||||
* @param options.speed=1 {number} 文字滚动速度
|
||||
* @param {object} options.position 位置
|
||||
* @param {number} options.position.lng 经度
|
||||
* @param {number} options.position.lat 纬度
|
||||
* @param {object} options.positions 坐标集[{lon,lat}]仅在未定义 position 时有效
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options)
|
||||
@ -649,7 +662,7 @@ class GroundText extends Base {
|
||||
ctx.font = 200 + 'px serif'
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0)'
|
||||
ctx.fillRect(0, 0, maxWidth + 30, 210)
|
||||
ctx.fillStyle = this.options.color
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 1)'
|
||||
ctx.font = '200px serif'
|
||||
ctx.fillText(textArray[i], 0, 210 * (i + 1))
|
||||
}
|
||||
|
@ -16,12 +16,23 @@ class StandText extends Base {
|
||||
* @param sdk
|
||||
* @description 立体文字
|
||||
* @param options {object}
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.text {string} 文字
|
||||
* @param options.color="#FFC107" {string} 颜色
|
||||
* @param options.speed=1 {number} 文字移动速度
|
||||
* @param {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
@ -508,7 +519,7 @@ class StandText extends Base {
|
||||
ctx.font = 200 + "px serif";
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 0)'
|
||||
ctx.fillRect(0, 0, maxWidth + 30, 210)
|
||||
ctx.fillStyle = this.options.color;
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 1)';
|
||||
ctx.font = "200px serif";
|
||||
ctx.fillText(textArray[i], 0, 210 * (i+1));
|
||||
}
|
||||
|
@ -23,7 +23,9 @@ class TrajectoryMotion extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @description 轨迹运动
|
||||
* @param sdk
|
||||
* @param options {object}
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.name {string} 名称
|
||||
* @param options.speed=1 {number} 运行速度
|
||||
* @param options.delay=0 {number} 运动延迟时间(毫秒)
|
||||
@ -33,22 +35,41 @@ class TrajectoryMotion extends Base {
|
||||
* @param options.state=true {boolean} 模型运动
|
||||
* @param options.routeDirection=true {boolean} 路径方向
|
||||
* @param options.viewFollow=false {boolean} 视角跟随
|
||||
* @param options.realTimeRoute=false {boolean} 实时路径
|
||||
* @param options.model {object} 模型参数
|
||||
* @param options.model.show=true {boolean} 模型显隐
|
||||
* @param options.model.url {url} 模型地址
|
||||
* @param options.model.url {string} 模型地址
|
||||
* @param options.model.pixelSize=70 {number} 模型像素大小
|
||||
* @param options.model.heading=0 {number}
|
||||
* @param options.model.pitch=0 {number}
|
||||
* @param options.model.roll=0 {number}
|
||||
* @param options.model.heading=0 {number} 模型航向角
|
||||
* @param options.model.pitch=0 {number} 模型俯仰角
|
||||
* @param options.model.roll=0 {number} 模型翻滚角
|
||||
* @param options.model.scale=1 {number} 模型比例
|
||||
* @param options.model.animate {string} 模型动画
|
||||
* @param options.line {object} 路径参数
|
||||
* @param options.line.show=true {boolean} 路径显隐
|
||||
* @param options.line.smooth=false {boolean} 路径圆滑
|
||||
* @param options.line.noseToTail=false {boolean} 路径收尾相联
|
||||
* @param options.line.noseToTail=false {boolean} 路径首尾相联
|
||||
* @param {Array.<object>} options.line.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
@ -1764,9 +1785,10 @@ class TrajectoryMotion extends Base {
|
||||
if (!cartesian3) {
|
||||
return
|
||||
}
|
||||
coordinates = _this.cartesian3Towgs84(cartesian3, viewer);
|
||||
let pos84 = _this.cartesian3Towgs84(cartesian3, viewer);
|
||||
coordinates = [pos84.lng, pos84.lat, pos84.alt + 1.8]
|
||||
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 = []
|
||||
for (let i = 0; i <= 1000; i++) {
|
||||
if ((i / 1000) > (distance / _this.distance)) {
|
||||
@ -1890,7 +1912,7 @@ class TrajectoryMotion extends Base {
|
||||
else {
|
||||
if (_this.sdk.viewer.trackedEntity) {
|
||||
_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: {
|
||||
heading: Cesium.Math.toRadians(-90),
|
||||
pitch: 0,
|
||||
|
@ -29,13 +29,47 @@ class WallRealStereoscopic extends Base {
|
||||
* @param options.color="#ffffff" {string} 颜色
|
||||
* @param options.width=0.24 {number} 宽
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options.extrudedHeight=2.4 {number} 拉伸高度
|
||||
* @param options.cornerType=0 {string} 拐角类型;0:直角;1:斜角;2:圆角
|
||||
* @param options.material=0 {number} 材质,0:纯色墙;1:红砖;2:黄砖;3:灰瓷
|
||||
* @param {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -23,12 +23,46 @@ class WallStereoscopic extends Base {
|
||||
* @param options.color="#00d9ff" {string} 颜色
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options.extrudedHeight=2.4 {number} 拉伸高度
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options.material=0 {number} 材质,0:纯色墙;1:上升墙;2:箭头墙;3:警戒墙
|
||||
* @param options.duration=1000 {number} 持续时间
|
||||
* @param {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -15,14 +15,17 @@ class WaterSurface extends Base {
|
||||
* @param sdk
|
||||
* @description 水面
|
||||
* @param options {object} 面属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options.name=未命名对象 {string} 名称
|
||||
* @param options.positions {Array.<{lng:number, lat:number, alt:number}>} 坐标数组
|
||||
* @param {Array.<object>} options.positions 坐标列表
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.color=rgba(32,67,135,0.5) {string} 颜色
|
||||
* @param options.frequency=100 {number} 频率
|
||||
* @param options.animationSpeed=0.02 {number} 动画速度
|
||||
* @param options.frequency=10 {number} 频率
|
||||
* @param options.animationSpeed=1 {number} 动画速度
|
||||
* @param options.amplitude=10 {number} 振幅
|
||||
* @param Dialog {object} 弹框对象
|
||||
* @param Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -137,7 +137,7 @@ class Base extends Tools {
|
||||
this.originalOptions.show = v
|
||||
}
|
||||
}
|
||||
this.entity._showView = this.showView
|
||||
this.entity && (this.entity._showView = this.showView)
|
||||
if (this.type == 'layer') {
|
||||
if (this.entity) {
|
||||
this.entity._objectState = this.options.show
|
||||
|
@ -100,7 +100,7 @@ function attributeElm(that) {
|
||||
let tr = `
|
||||
<div class="tr">
|
||||
<div class="td">
|
||||
<input type="checkbox" value="${'ID' in data.data.list[i] ? data.data.list[i].ID : data.data.list[i].id}">
|
||||
<input type="checkbox" value="${data.data.list[i].deviceId}">
|
||||
<span>绑定</span>
|
||||
</div>
|
||||
<div class="td">${data.data.list[i].cameraName}</div>
|
||||
@ -126,11 +126,8 @@ function attributeElm(that) {
|
||||
}
|
||||
else {
|
||||
let newArray = that.attributeCamera.filter((item) => {
|
||||
if ('ID' in data.data.list[i]) {
|
||||
return item.ID !== data.data.list[i].ID
|
||||
}
|
||||
else {
|
||||
return item.id !== data.data.list[i].id
|
||||
if ('deviceId' in data.data.list[i]) {
|
||||
return item.deviceId !== data.data.list[i].deviceId
|
||||
}
|
||||
})
|
||||
that.attributeCamera = newArray
|
||||
@ -139,7 +136,7 @@ function attributeElm(that) {
|
||||
tableContent.appendChild(trElm)
|
||||
|
||||
for (let m = 0; m < that.attributeCamera.length; m++) {
|
||||
if (('ID' in data.data.list[i]) ? (that.attributeCamera[m].ID === data.data.list[i].ID) : (that.attributeCamera[m].id === data.data.list[i].id)) {
|
||||
if (('deviceId' in data.data.list[i]) ? (that.attributeCamera[m].deviceId === data.data.list[i].deviceId):false) {
|
||||
checkbox.checked = true
|
||||
break
|
||||
}
|
||||
@ -200,17 +197,9 @@ function attributeElm(that) {
|
||||
for (let i = that.attributeCamera.length - 1; i >= 0; i--) {
|
||||
let flag = false
|
||||
for (let m = 0; m < data.data.list.length; m++) {
|
||||
if ('ID' in data.data.list[m]) {
|
||||
if (that.attributeCamera[i].ID === data.data.list[m].ID) {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if ('id' in data.data.list[m]) {
|
||||
if (that.attributeCamera[i].id === data.data.list[m].id) {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
if (that.attributeCamera[i].deviceId === data.data.list[m].deviceId) {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
|
@ -50,7 +50,8 @@ export default class CircleDiffuseMaterialProperty {
|
||||
let color = this.colors[ratio[i]]
|
||||
_sourceColor = _sourceColor + `
|
||||
if(dis < float(${Number(ratio[i]) / 2})) {
|
||||
material.diffuse = 1.5 * vec4(${color.red},${color.green},${color.blue},${color.alpha}).rgb;
|
||||
material.diffuse = vec4(0.0,0.0,0.0,0.0).rgb;
|
||||
material.emission = 1.0 * vec4(${color.red},${color.green},${color.blue},${color.alpha}).rgb;
|
||||
}
|
||||
`
|
||||
}
|
||||
@ -110,7 +111,7 @@ export default class CircleDiffuseMaterialProperty {
|
||||
transparency: 1,
|
||||
count: 4,
|
||||
gradient: 0.2,
|
||||
frameNumber: Cesium.getTimestamp(),
|
||||
frameNumber: Cesium.getTimestamp(),
|
||||
},
|
||||
source: this._source,
|
||||
},
|
||||
|
@ -238,8 +238,8 @@ function StreamWall2() {
|
||||
else {
|
||||
material.alpha = 1.0;
|
||||
}
|
||||
material.diffuse = color.rgb*0.0;
|
||||
material.emission = color.rgb * 1.0;
|
||||
material.diffuse = colorImage.rgb * color.rgb*0.0;
|
||||
material.emission = colorImage.rgb * color.rgb * 1.0;
|
||||
return material;
|
||||
}`,
|
||||
components: {
|
||||
|
@ -1493,6 +1493,30 @@ class Tools {
|
||||
}
|
||||
}
|
||||
|
||||
message(option = {}) {
|
||||
let type = option.type || 'success'
|
||||
let text = option.text || ''
|
||||
let duration = option.duration || 1500
|
||||
|
||||
let message = document.getElementById('YJ-custom-message');
|
||||
if (message) {
|
||||
document.body.removeChild(message)
|
||||
}
|
||||
message = document.createElement('div')
|
||||
message.id = 'YJ-custom-message'
|
||||
if (type == 'success') {
|
||||
message.innerHTML = `
|
||||
<i><?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1755929961282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5064" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0" fill="#52C41A" p-id="5065"></path></svg></i>${text}
|
||||
`
|
||||
} else if (type == 'warning') {
|
||||
message.innerHTML = `
|
||||
<i><?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1756093599258" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1648" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M512.002558 64.24521c-247.292176 0-447.75786 200.464661-447.75786 447.756837 0 247.287059 200.464661 447.752744 447.75786 447.752744 247.286036 0 447.75172-200.464661 447.75172-447.752744C959.754279 264.710894 759.288594 64.24521 512.002558 64.24521zM512.010745 735.87586c-20.602224 0-37.319977-16.718777-37.319977-37.323047 0-20.597107 16.717753-37.319977 37.319977-37.319977 20.60427 0 37.297464 16.72287 37.297464 37.319977C549.308209 719.158107 532.613992 735.87586 512.010745 735.87586zM549.308209 567.969733c0 20.600177-16.693194 37.293371-37.297464 37.293371-20.602224 0-37.319977-16.693194-37.319977-37.293371L474.690768 325.420581c0-20.605294 16.717753-37.297464 37.319977-37.297464 20.60427 0 37.297464 16.693194 37.297464 37.297464L549.308209 567.969733z" fill="#e98f36" p-id="1649"></path></svg></i>${text}
|
||||
`
|
||||
}
|
||||
|
||||
document.body.appendChild(message)
|
||||
message.classList.add(type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import AModelLoader from '../Obj/Base/LoadObjModel/AModelLoader'
|
||||
import { setSvg } from '../Obj/Element/svg'
|
||||
import Tools from '../Tools'
|
||||
import { Proj } from '../Tools/proj'
|
||||
import { syncData, getSdk } from '../Global/MultiViewportMode'
|
||||
import {
|
||||
unRegLeftClickCallback,
|
||||
unRegRightClickCallback,
|
||||
@ -62,9 +63,9 @@ class YJEarth {
|
||||
|
||||
removeIncetance(id) {
|
||||
this.entityMap.delete(id)
|
||||
unRegLeftClickCallback(this,id)
|
||||
unRegRightClickCallback(this,id)
|
||||
unregMoveCallback(this,id)
|
||||
unRegLeftClickCallback(this, id)
|
||||
unRegRightClickCallback(this, id)
|
||||
unregMoveCallback(this, id)
|
||||
|
||||
syncSplitData(this, id)
|
||||
}
|
||||
@ -151,7 +152,7 @@ class YJEarth {
|
||||
}
|
||||
this.options.contextOptions = {
|
||||
webgl: {
|
||||
alpha: true,
|
||||
// alpha: true,
|
||||
depth: true,
|
||||
stencil: true,
|
||||
antialias: true,
|
||||
@ -419,7 +420,8 @@ class YJEarth {
|
||||
|
||||
let ClickHandler = new Cesium.ScreenSpaceEventHandler(_this.viewer.canvas)
|
||||
ClickHandler.setInputAction((movement) => {
|
||||
let textList = document.getElementsByClassName('popup-textarea')
|
||||
// let textList = document.getElementsByClassName('popup-textarea')
|
||||
let textList = _this.viewer._element.getElementsByClassName('popup-textarea')
|
||||
_this.isLeftClick = false
|
||||
for (let i = textList.length - 1; i > -1; i--) {
|
||||
let left = returnNumber(textList[i].style.left)
|
||||
@ -431,11 +433,20 @@ class YJEarth {
|
||||
if (x > left && x < left + width && y > top && y < top + height) {
|
||||
if (_this.clickTextDom) {
|
||||
_this.clickTextDom.style['pointer-events'] = 'none'
|
||||
_this.clickTextDom.querySelector('textarea').removeEventListener('blur', _this.blurFun)
|
||||
}
|
||||
|
||||
_this.clickTextDom = textList[i]
|
||||
textList[i].style['pointer-events'] = 'all'
|
||||
textList[i].querySelector('textarea').focus()
|
||||
_this.isLeftClick = true
|
||||
_this.entityMap.get(_this.clickTextDom.id).isClick(movement.position, _this.clickTextDom.id)
|
||||
|
||||
_this.blurFun = () => {
|
||||
_this.entityMap.get(_this.clickTextDom.id).isClick((movement && movement.position) || null, _this.clickTextDom.id)
|
||||
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||
}
|
||||
_this.clickTextDom.querySelector('textarea').addEventListener('blur', _this.blurFun)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -466,6 +477,11 @@ class YJEarth {
|
||||
x: e.clientX - layerX + width / 2,
|
||||
y: e.clientY - layerY + height,
|
||||
}
|
||||
let { sdkP } = getSdk()
|
||||
if (_this != sdkP && sdkP) {//二维
|
||||
let num = sdkP.viewer._element.clientWidth
|
||||
param.x = param.x - num
|
||||
}
|
||||
_this.entityMap.get(_this.clickTextDom.id).setHandeler(param)
|
||||
|
||||
}
|
||||
@ -477,14 +493,14 @@ class YJEarth {
|
||||
}
|
||||
|
||||
_this.clickTextDom.addEventListener('mousedown', mousedown);
|
||||
document.addEventListener('mousemove', mousemove);
|
||||
document.addEventListener('mouseup', mouseup);
|
||||
_this.viewer._element.addEventListener('mousemove', mousemove);
|
||||
_this.viewer._element.addEventListener('mouseup', mouseup);
|
||||
}
|
||||
// 点击其他地方取消
|
||||
if (!_this.isLeftClick && _this.clickTextDom) {
|
||||
_this.clickTextDom.removeEventListener('mousedown', mousedown);
|
||||
document.removeEventListener('mousemove', mousemove);
|
||||
document.removeEventListener('mouseup', mouseup);
|
||||
_this.viewer._element.removeEventListener('mousemove', mousemove);
|
||||
_this.viewer._element.removeEventListener('mouseup', mouseup);
|
||||
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||
|
||||
_this.clickTextDom.style['pointer-events'] = 'none'
|
||||
|
@ -3493,6 +3493,7 @@
|
||||
cursor: e-resize;
|
||||
background-color: #d3d3d3;
|
||||
user-select: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cesium-performanceDisplay-defaultContainer {
|
||||
@ -3627,6 +3628,7 @@
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.billboard-attribute-box .DIV-cy-tabs .DIV-cy-tab-top .DIV-cy-tab-pane-title {
|
||||
@ -3761,4 +3763,61 @@
|
||||
|
||||
.billboard-attribute-box .table .table-body .tr:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 自定义提示 */
|
||||
#YJ-custom-message {
|
||||
/* 固定在顶部中央 */
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0%);
|
||||
/* 初始位置在屏幕顶部外 */
|
||||
|
||||
/* 样式美化 */
|
||||
display: flex;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
padding: 15px 20px;
|
||||
width: 380px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
z-index: 9999999;
|
||||
|
||||
|
||||
/* 动画定义 */
|
||||
animation: YJ-custom-message-slideDown 0.5s forwards,
|
||||
YJ-custom-message-fadeOut 0.5s 1500ms forwards;
|
||||
}
|
||||
|
||||
#YJ-custom-message i {
|
||||
margin: 2px 10px 0 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
#YJ-custom-message.success {
|
||||
background-color: #f0f9eb;
|
||||
color: rgb(82, 196, 26);
|
||||
}
|
||||
#YJ-custom-message.warning {
|
||||
background-color: #fdf6ec;
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
/* 滑入动画 */
|
||||
@keyframes YJ-custom-message-slideDown {
|
||||
to {
|
||||
top: 20px;
|
||||
/* 移动到屏幕顶部 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 淡出动画 - 1500ms后执行 */
|
||||
@keyframes YJ-custom-message-fadeOut {
|
||||
to {
|
||||
opacity: 0;
|
||||
top: -200px
|
||||
/* 移回顶部外 */
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user