Compare commits

..

7 Commits

54 changed files with 606 additions and 2424 deletions

View File

@ -227,7 +227,7 @@ export default class DrawCircle extends Draw {
return '半径:' + radius + ' 米'
}, false),
font: '20px Microsoft YaHei',
disableDepthTestDistance: Number.POSITIVE_INFINITY,
distanceDisplayCondition: 10000000,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,

View File

@ -31,13 +31,12 @@ class DrawSector extends Draw {
this._sector_id = null; //扇形
this._positions = []; //活动点
this.points_ids = []; //脏数据
this.radius_points = []
this._entities_sector = []; //脏数据
this._radius = 0; //半径
this._startAngle = 0; //起始角度
this._endAngle = 0; //结束角度
this.event.mouse_left((movement, cartesian) => {
if (into === '2D') {
if(into === '2D') {
return
}
into = '3D'
@ -52,17 +51,13 @@ class DrawSector extends Draw {
cb(null, { center: this._positions[0], radius: this._radius, startAngle: this._startAngle, endAngle: this._endAngle })
}
if (this._positions.length === 2) {
this.radius_points.push(cartesian)
this._radius = this.computeDistance2([this._positions[0], this._positions[1]]);
}
if (this._positions.length === 1) {
this.radius_points.push(cartesian)
let lineId = this.createRadiusLine();
this.points_ids.push(lineId);
let pointA = Cesium.Cartesian3.fromDegrees(this._positions[0].lng, this._positions[0].lat, this._positions[0].alt);
let pointB = cartesian;
this._radius = Cesium.Cartesian3.distance(pointA, pointB);
}
})
this.event.mouse_move((movement, cartesian) => {
if (into === '2D') {
if(into === '2D') {
return
}
this.tip.setPosition(
@ -70,11 +65,6 @@ class DrawSector extends Draw {
movement.endPosition.x,
movement.endPosition.y
)
if (this._positions.length === 1) {
this.radius_points[1] = cartesian
let endpoint = this.cartesian3Towgs84(cartesian, this.viewer)
this._radius = this.computeDistance2([this._positions[0], endpoint]);
};
if (this._positions.length < 2) return;
if (this._positions.length == 2) {
this._positions.push(this.cartesian3Towgs84(cartesian, this.viewer));
@ -94,7 +84,7 @@ class DrawSector extends Draw {
})
this.event.mouse_right((movement, cartesian) => {
if (into === '2D') {
if(into === '2D') {
return
}
this.end()
@ -103,12 +93,12 @@ class DrawSector extends Draw {
if (!this._is2D && this._sdk2D) {
this.event2D = new MouseEvent(this._sdk2D)
this.event2D.mouse_left((movement, cartesian) => {
if (into === '3D') {
if(into === '3D') {
return
}
into = '2D'
// if(that._positions.length == 3) return
if (this._positions.length < 3) {
this.points_ids.push(this.create_point(cartesian, this._sdk2D.viewer));
this._positions.push(this.cartesian3Towgs84(cartesian, this.viewer));
@ -118,12 +108,13 @@ class DrawSector extends Draw {
cb(null, { center: this._positions[0], radius: this._radius, startAngle: this._startAngle, endAngle: this._endAngle })
}
if (this._positions.length === 2) {
let endpoint = this.cartesian3Towgs84(cartesian, this.viewer)
this._radius = this.computeDistance2([this._positions[0], endpoint]);
let pointA = Cesium.Cartesian3.fromDegrees(this._positions[0].lng, this._positions[0].lat, this._positions[0].alt);
let pointB = cartesian;
this._radius = Cesium.Cartesian3.distance(pointA, pointB);
}
})
this.event2D.mouse_move((movement, cartesian) => {
if (into === '3D') {
if(into === '3D') {
return
}
this.tip.setPosition(
@ -142,15 +133,15 @@ class DrawSector extends Draw {
this._sector_id = this.createsector(this._sdk2D.viewer);
this.points_ids.push(this._sector_id);
}
let options = that.calculateAangle(that._positions)
that._startAngle = options.angle1;
that._endAngle = options.angle2;
}
})
this.event2D.mouse_right((movement, cartesian) => {
if (into === '3D') {
if(into === '3D') {
return
}
this.end()
@ -207,49 +198,6 @@ class DrawSector extends Draw {
that._entities_sector.push(arrowEntity);
return id
}
//创建半径线
createRadiusLine(viewer = this.viewer) {
let that = this;
let id = that.randomString()
let arrowEntity = viewer.entities.add({
id: id,
position: new Cesium.CallbackProperty((e) => {
let center = that._positions[0]
let endpoint = that.radius_points[1] ? that.cartesian3Towgs84(that.radius_points[1], that.viewer) : that._positions[0]
let c = that.computeMidpoint(center, endpoint)
return Cesium.Cartesian3.fromDegrees(c.lng, c.lat, endpoint.alt)
}, false),
polyline: {
positions: new Cesium.CallbackProperty((e) => {
return that.radius_points
}, false),
width: 2,
material:
Cesium.Color.fromCssColorString('#c1c505').withAlpha(0.5),
clampToGround: true,
zIndex: 999999999
},
label: {
text: new Cesium.CallbackProperty((e) => {
if (this._radius > 1000) {
return '半径:' + (this._radius / 1000).toFixed(2) + ' 公里'
}
return '半径:' + this._radius + ' 米'
}, false),
font: '20px Microsoft YaHei',
disableDepthTestDistance: Number.POSITIVE_INFINITY,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
fillColor: Cesium.Color.fromCssColorString('#f5ce0a'),
style: Cesium.LabelStyle.FILL_AND_OUTLINE
},
}
)
that._entities_sector.push(arrowEntity);
return id
}
cartesianToLatlng(cartesian) {
let latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);

View File

@ -14,15 +14,15 @@ function html() {
<div class="div-item">
<div class="row">
<div class="col">
<input type="checkbox" name="isTotalTime" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">
<span class="label">设置总时长</span>
<div class="input-number input-number-unit-3">
<input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01" name="totalTime" value="0">
<span class="unit" style="top: 6px;">秒(s)</span>
<span class="arrow"></span>
</div>
<button class="set-total-time-btn" style="margin-left: 5px;">应用</button>
</div>
<div class="col" style="justify-content: flex-end;">
<div class="col">
<input type="checkbox" name="repeat" style="width: 16px; line-height: 15px; height: 15px; cursor: pointer; width: auto; margin-right: 5px;">
<span class="label">是否循环播放</span>
</div>

View File

@ -139,10 +139,11 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
})
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
let setTotalTimeBtn = contentElm.getElementsByClassName('set-total-time-btn')[0]
setTotalTimeBtn.addEventListener('click', () => {
if (points.length > 0) {
let trList = tableBody.getElementsByClassName('tr')
let isTotalTimeElm = contentElm.querySelector("input[name='isTotalTime']")
let repeatElm = contentElm.querySelector("input[name='repeat']")
isTotalTimeElm.addEventListener('change', () => {
let trList = tableBody.getElementsByClassName('tr')
if (isTotalTimeElm.checked && trList.length > 0) {
let time = Number((Number(totalTimeElm.value) / (trList.length - 1)).toFixed(2))
for (let i = 0; i < trList.length - 1; i++) {
points[i].duration = time
@ -151,12 +152,20 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
trList[trList.length - 1].querySelector("input[name='time']").value = 0
}
})
let repeatElm = contentElm.querySelector("input[name='repeat']")
totalTimeElm.addEventListener('blur', () => {
let trList = tableBody.getElementsByClassName('tr')
totalTimeElm.value = Number(totalTimeElm.value)
if (totalTimeElm.value < 0) {
totalTimeElm.value = 0
}
if (isTotalTimeElm.checked && trList.length > 0) {
let time = Number((Number(totalTimeElm.value) / (trList.length - 1)).toFixed(2))
for (let i = 0; i < trList.length - 1; i++) {
points[i].duration = time
trList[i].querySelector("input[name='time']").value = time
}
trList[trList.length - 1].querySelector("input[name='time']").value = 0
}
})
repeatElm.checked = (repeat === Infinity ? true : false)
repeatElm.addEventListener('change', () => {
@ -277,6 +286,7 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
// }
})
e_time.addEventListener('input', (v) => {
isTotalTimeElm.checked = false
data.duration = Number(e_time.value)
if (data.duration < 0) {
data.duration = 0

View File

@ -6,7 +6,7 @@ import { getTemplateData } from './dataSource.js'
let tools = new Tools();
async function MapPrint(sdk, thumbnailImg, rectangle, originalImg, totalCanvas, scale) {
async function MapPrint(sdk, thumbnailImg, rectangle, originalImg) {
let exporting = false;
let templateData = getTemplateData(tools)
let _DialogObject
@ -290,48 +290,21 @@ async function MapPrint(sdk, thumbnailImg, rectangle, originalImg, totalCanvas,
let closeBtn
let exportBtn
let saveBtn
setTimeout(() => {
closeBtn = _DialogObject._element.foot.getElementsByClassName('close')[0]
exportBtn = document.createElement('button')
exportBtn.className = 'export';
exportBtn.innerHTML = '打印';
exportBtn.style.right = '150px'
leftElm.appendChild(closeBtn)
leftElm.appendChild(exportBtn)
saveBtn = document.createElement('button')
saveBtn.className = 'export';
saveBtn.innerHTML = '保存';
leftElm.appendChild(closeBtn)
leftElm.appendChild(saveBtn)
exportBtn.addEventListener('click', function () {
if (exporting) {
return
}
exporting = true
exportBtn.innerHTML = '<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>打印'
saveBtn.innerHTML = '<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>保存'
exportMap('export')
// exporting = true
// exportBtn.innerHTML = '<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>打印'
// let imgBlobData = canvas.toDataURL();
// let downloadElement = document.createElement('a');
// downloadElement.href = imgBlobData;
// downloadElement.download = `高清出图-${getDateTimeString()}.png`;
// document.body.appendChild(downloadElement);
// downloadElement.click();
// document.body.removeChild(downloadElement);
// URL.revokeObjectURL(imgBlobData);
})
saveBtn.addEventListener('click', function () {
if (exporting) {
return
}
exporting = true
exportBtn.innerHTML = '<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>打印'
saveBtn.innerHTML = '<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>保存'
exportMap('save')
exportMap()
// exporting = true
// exportBtn.innerHTML = '<span style="position: absolute;width:100%;height:100%;top: 0;left: 0;border-radius: 3px;background-color: #6f89848f;"><svg class="icon-load"><use xlink:href="#yj-icon-load"></use></svg></span>打印'
// let imgBlobData = canvas.toDataURL();
@ -1224,52 +1197,12 @@ async function MapPrint(sdk, thumbnailImg, rectangle, originalImg, totalCanvas,
return `${year}${month}${day}${hours}${minutes}${seconds}${milliseconds}`;
}
function exportMap(type) {
let iframeDoc = document
function exportMap() {
let unitDistance2
let iframe
if (type === 'export') {
iframe = document.createElement('iframe');
iframe.id = 'printIframe';
// iframe.src = 'print.html';
iframe.frameborder = '0';
iframe.style.position = 'absolute';
iframe.style.zIndex = '-9999999';
iframe.style.width = '100vw';
iframe.style.height = '100vh';
iframe.style.left = '0';
iframe.style.top = '0';
document.body.appendChild(iframe);
iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
}
let canvas2 = iframeDoc.createElement('canvas');
if (type === 'export') {
canvas2.style.width = '100%'
canvas2.style.height = '100%'
canvas2.style.objectFit = 'contain';
iframeDoc.body.appendChild(canvas2);
}
let canvas2 = document.createElement('canvas');
let ctx2 = canvas2.getContext('2d');
let imgElm2 = new Image();
if (type === 'export') {
const tempCanvas = document.createElement('canvas');
const tempCtx = tempCanvas.getContext('2d');
if(scale>=3) {
tempCanvas.width = totalCanvas.width / scale * 2
tempCanvas.height = totalCanvas.height / scale * 2
tempCtx.drawImage(totalCanvas, 0, 0, tempCanvas.width, tempCanvas.height);
imgElm2.src = tempCanvas.toDataURL('image/jpeg', 0.95)
}
else {
imgElm2.src = originalImg
}
}
else {
imgElm2.src = originalImg
}
imgElm2.src = originalImg
imgElm2.onload = function () {
if (isLoad) {
return
@ -1483,36 +1416,17 @@ async function MapPrint(sdk, thumbnailImg, rectangle, originalImg, totalCanvas,
// 在释放资源后执行回调
if (type === 'export') {
const iframeWindow = iframe.contentWindow;
if (iframeWindow && typeof iframeWindow.print === 'function') {
iframeWindow.addEventListener('afterprint', function () {
document.body.removeChild(iframe)
})
iframeWindow.print();
} else {
console.error('打印失败,请手动保存截图');
}
}
else {
canvas2.toBlob(function (blob) {
const url = URL.createObjectURL(blob);
let downloadElement = document.createElement('a');
downloadElement.href = url;
downloadElement.download = `高清出图-${getDateTimeString()}.png`;
document.body.appendChild(downloadElement);
downloadElement.click();
document.body.removeChild(downloadElement);
URL.revokeObjectURL(url);
}, 'image/png', 0.95);
}
canvas2.toBlob(function (blob) {
const url = URL.createObjectURL(blob);
let downloadElement = document.createElement('a');
downloadElement.href = url;
downloadElement.download = `高清出图-${getDateTimeString()}.png`;
document.body.appendChild(downloadElement);
downloadElement.click();
document.body.removeChild(downloadElement);
}, 'image/png', 0.95);
exporting = false;
exportBtn.innerHTML = '打印';
saveBtn.innerHTML = '保存';
// canvas2.toBlob(function (blob) {
// let imgBlobData = URL.createObjectURL(blob);
// let downloadElement = document.createElement('a');

View File

@ -123,7 +123,6 @@ async function ScreenShotHD(sdk, options = {}, cd = () => { }) {
startScreenShotObject.desist()
startScreenShotObject = null
}
window.removeEventListener('resize', resize)
_DialogObject = undefined
}
})
@ -134,7 +133,7 @@ async function ScreenShotHD(sdk, options = {}, cd = () => { }) {
<div class="div-item">
<div class="row text" style="align-items: flex-start;">
<div class="col">
<span>当前窗口长宽:<span class="input-width canvas-width-span">${sdk.viewer.canvas.width}</span>*<span class="input-height canvas-height-span">${sdk.viewer.canvas.height}</span>像素</span>
<span>当前窗口长宽:<span class="input-width">${sdk.viewer.canvas.width}</span>*<span class="input-height">${sdk.viewer.canvas.height}</span>像素</span>
</div>
</div>
<div class="row scale-box" style="align-items: flex-start;">
@ -177,17 +176,6 @@ async function ScreenShotHD(sdk, options = {}, cd = () => { }) {
sdk.viewer.scene.screenSpaceCameraController.enableLook = false;
sdk.viewer._element.getElementsByClassName('compass')[0].style.pointerEvents = 'none'
window.addEventListener('resize', resize);
function resize() {
setTimeout(() => {
contentElm.getElementsByClassName('canvas-width-span')[0].innerHTML = sdk.viewer.canvas.width
contentElm.getElementsByClassName('canvas-height-span')[0].innerHTML = sdk.viewer.canvas.height
contentElm.getElementsByClassName('output-width')[0].innerHTML = sdk.viewer.canvas.width * scale
contentElm.getElementsByClassName('output-height')[0].innerHTML = sdk.viewer.canvas.height * scale
}, 500);
}
let centerResult = sdk.viewer.camera.pickEllipsoid(
new Cesium.Cartesian2(

View File

@ -166,9 +166,6 @@ function open(sdk) {
}
let isChanged = false
let rectangle = getViewExtend();
if(!rectangle) {
return
}
let minLng = Cesium.Math.toDegrees(rectangle.west)
let minLat = Cesium.Math.toDegrees(rectangle.south)

View File

@ -4,7 +4,6 @@ import DrawPolygon from "../../../Draw/drawPolygon"
import Tools from "../../../Tools";
import { closeRotateAround, closeViewFollow} from '../../../Global/global'
class Submerge extends Tools {
#_isupdate = false
/**
* @constructor
* @param sdk
@ -159,12 +158,10 @@ class Submerge extends Tools {
e_risingSpeed[0].value = that.options.risingSpeed
e_risingSpeed[1].value = that.options.risingSpeed
e_risingSpeed[0].addEventListener('input', e => {
that.#_isupdate = true
that.options.risingSpeed = Number(e.target.value);
});
e_risingSpeed[1].addEventListener('input', e => {
if (e.data != '.') {
that.#_isupdate = true
let value = Number(e.target.value)
let max = Number(e_risingSpeed[0].max)
let min = Number(e_risingSpeed[0].min)
@ -194,7 +191,6 @@ class Submerge extends Tools {
e_minWaterLevel.value = that.options.minWaterLevel
e_minWaterLevel.addEventListener('input', e => {
if (e.data != '.') {
that.#_isupdate = true
let value = Number(e.target.value)
if (value > 999999999) {
value = 999999999
@ -220,7 +216,6 @@ class Submerge extends Tools {
e_maxWaterLevel.value = that.options.maxWaterLevel
e_maxWaterLevel.addEventListener('input', e => {
if (e.data != '.') {
that.#_isupdate = true
let value = Number(e.target.value)
if (value > 999999999) {
value = 999999999
@ -255,7 +250,6 @@ class Submerge extends Tools {
e_waterVolume.value = that.options.waterVolume
e_waterVolume.addEventListener('input', e => {
if (e.data != '.') {
that.#_isupdate = true
let value = Number(e.target.value)
if (value > 99999999999999) {
value = 99999999999999
@ -325,24 +319,19 @@ class Submerge extends Tools {
if (this.TweenAnimate) {
TWEEN.remove(this.TweenAnimate)
}
this.#_isupdate = false
let contentElm = this._DialogObject._element.body
let pauseBtn = contentElm.getElementsByClassName('pause')[0];
let startBtn = contentElm.getElementsByClassName('start')[0];
let totalTime = ((this.options.maxWaterLevel - this.options.minWaterLevel) / this.options.risingSpeed) * 1000
this.TweenAnimate = new TWEEN.Tween({ waterLevel: this.options.minWaterLevel }).to({ waterLevel: this.options.maxWaterLevel }, totalTime).delay(this.delay).easing(TWEEN.Easing.Linear.None).onUpdate(async (r, a) => {
this.currentWaterLaver = r.waterLevel
}).onComplete(()=>{
startBtn.style.display = 'flex'
pauseBtn.style.display = 'none'
}).start()
let contentElm = this._DialogObject._element.body
let pauseBtn = contentElm.getElementsByClassName('pause')[0];
let startBtn = contentElm.getElementsByClassName('start')[0];
startBtn.style.display = 'none'
pauseBtn.style.display = 'flex'
}
restart() {
this.currentWaterLaver = this.options.minWaterLevel
this.#_isupdate = false
let isPaused = false
if (this.TweenAnimate) {
isPaused = this.TweenAnimate._isPaused
@ -359,17 +348,7 @@ class Submerge extends Tools {
start() {
if (this.TweenAnimate) {
if(this.#_isupdate) {
this.move()
}
else {
if(this.TweenAnimate._isPlaying) {
this.TweenAnimate.resume()
}
else {
this.TweenAnimate.start()
}
}
this.TweenAnimate.resume()
}
}
pause() {

View File

@ -397,9 +397,6 @@ class ViewShedStage extends Tools {
ctx.fillText(item.text, 44, 28 + (index * 26));
imagesLoaded++;
if (imagesLoaded === data.length) {
if (that.viewBillboardPrimitive) {
that.viewer.scene.primitives.remove(that.viewBillboardPrimitive)
}
that.viewBillboardPrimitive = that.viewer.scene.primitives.add(new Cesium.BillboardCollection())
that.viewBillboardPrimitive.add({
position: Cesium.Cartesian3.fromDegrees(that.viewPosition.lng, that.viewPosition.lat, that.viewPosition.alt + that.viewPointHeight),

View File

@ -22,53 +22,14 @@ 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='rgba(255, 0, 0, 0.5)' {string} 颜色
* @param options.color="#ff000080" {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 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} 高度
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);

View File

@ -22,56 +22,14 @@ 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='rgba(255, 0, 0, 0.5)' {string} 颜色
* @param options.color="#ff000080" {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 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} 高度
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);
@ -893,7 +851,7 @@ class AttackArrowObject extends Base {
}
that.positions = Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)
let positionsA = that.computeAttackArrow(that.options.positions)
if (positionsA.length == 0 || Array.isArray(positionsA[0])) {
if (positionsA.length == 0) {
return
}
@ -1623,7 +1581,7 @@ class AttackArrowObject extends Base {
_addRr() {
if (this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value) {
this.options.attribute.vr.content.push({
name: '全景图',
name: '全景图' ,
url: this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value
})
this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value = ''
@ -1636,7 +1594,7 @@ class AttackArrowObject extends Base {
addAttributeRr(vr) {
this.options.attribute.vr.content.push({
name: '全景图',
name: '全景图' ,
url: vr
})
this.attributeVr = this.options.attribute.vr.content
@ -2189,23 +2147,22 @@ class AttackArrowObject extends Base {
that.event.mouse_right_keyboard_ctrl((movement, cartesian) => {
if (selectPoint) {
if (that.options.positions.length > 3) {
that.options.positions.pop()
that.sdk.viewer.entities.remove(that.nodePoints[that.nodePoints.length - 1])
that.nodePoints.pop()
if (!selectPoint.index) {
// selectPoint = null
}
else if (selectPoint.index === that.options.positions.length) {
if (that.nodePoints[selectPoint.index - 1]) {
selectPoint = that.nodePoints[selectPoint.index - 1]
}
else {
selectPoint.index = selectPoint.index - 1
}
}
that.renewPositions()
that.options.positions.pop()
that.sdk.viewer.entities.remove(that.nodePoints[that.nodePoints.length - 1])
that.nodePoints.pop()
if (!selectPoint.index) {
// selectPoint = null
}
else if (selectPoint.index === that.options.positions.length) {
if (that.nodePoints[selectPoint.index - 1]) {
selectPoint = that.nodePoints[selectPoint.index - 1]
}
else {
selectPoint.index = selectPoint.index - 1
}
}
that.renewPositions()
}
})
@ -2318,7 +2275,7 @@ class AttackArrowObject extends Base {
}
}
let arr = this.computeAttackArrow(positions84)
if (arr.length == 0 || Array.isArray(arr[0])) {
if (arr.length == 0) {
return
}
this.entity.polygon.hierarchy = new Cesium.CallbackProperty(function () {
@ -2339,7 +2296,7 @@ class AttackArrowObject extends Base {
options.y = (options.y || options.y === 0) ? options.y : 10
let positions = this.computeAttackArrow(this.options.positions)
if (positions.length == 0 || Array.isArray(positions[0])) {
if (positions.length == 0) {
return
}
let points = [[]]
@ -2610,13 +2567,11 @@ class AttackArrowObject extends Base {
this.positions = Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)
let positionsA = this.computeAttackArrow(positions)
if (positionsA.length == 0 || Array.isArray(positionsA[0])) {
this.positionsH = [this.positions[0], this.positions[0], this.positions[0]]
if (positionsA.length == 0) {
return
}
let points = [[]]
let pos84 = []
for (let i = 0; i < positionsA.length; i++) {
let position = this.cartesian3Towgs84(positionsA[i], this.sdk.viewer)
pos84.push(position)

View File

@ -17,62 +17,30 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../..
class Model extends BaseModel {
#timeoutEventObject = null
/**
* @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
* @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(earth, options = {}, _Dialog = {}) {
super(earth, options, _Dialog = {})

View File

@ -230,17 +230,6 @@ class Tileset extends BaseTileset {
else {
this.rotationEditing = true
}
if (!this.tileset.root.transform) {
if (window.ELEMENT) {
window.ELEMENT.Message.closeAll();
window.ELEMENT.Message({
message: '该模型不支持移动和旋转!',
type: 'warning',
duration: 1500
});
}
return
}
},
translationalCallBack: () => {
if (this.positionEditing) {
@ -249,17 +238,6 @@ class Tileset extends BaseTileset {
else {
this.positionEditing = true
}
if (!this.tileset.root.transform) {
if (window.ELEMENT) {
window.ELEMENT.Message.closeAll();
window.ELEMENT.Message({
message: '该模型不支持移动和旋转!',
type: 'warning',
duration: 1500
});
}
return
}
}
}, true)
document.getElementsByTagName('head')[0].appendChild(this._element_style);
@ -285,14 +263,14 @@ class Tileset extends BaseTileset {
//更新模型位置
updateModel(_tx, _ty, _tz, _rx = 0, _ry = 0, _rz = 0, s = 1) {
if (!this.tileset.root.transform) {
// if (window.ELEMENT) {
// window.ELEMENT.Message.closeAll();
// window.ELEMENT.Message({
// message: '该模型不支持移动和旋转!',
// type: 'warning',
// duration: 1500
// });
// }
if (window.ELEMENT) {
window.ELEMENT.Message.closeAll();
window.ELEMENT.Message({
message: '该模型不支持移动和旋转!',
type: 'warning',
duration: 1500
});
}
console.warn('该模型不支持移动和旋转!')
return
}

View File

@ -74,33 +74,35 @@ 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;
if (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)
}
// this.callback(this.options);
(this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this)
})
} else {
@ -115,51 +117,59 @@ class BatchModel extends Base {
let posiArr = []
let array = []
if (that.options.type == '面') {
that.options.positions.forEach(item => {
fromDegreesArray.push(item.lng, item.lat)
})
// arr = that.generateInterpolatedPoints(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
arr = await that.computedArea(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
array[0] = arr
array[1] = that.calculateRoadAngle(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[0], Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[3])
arr.forEach((item, index) => {
const cartographic = Cesium.Cartographic.fromCartesian(
item // Cartesian3对象 {x, y, z}
);
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height;
posiArr.push({
lng: longitude,
lat: latitude,
alt: height
if (that.options.positions.length != 0) {
that.options.positions.forEach(item => {
fromDegreesArray.push(item.lng, item.lat)
})
})
// arr = that.generateInterpolatedPoints(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
arr = await that.computedArea(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
array[0] = arr
array[1] = that.calculateRoadAngle(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[0], Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[3])
arr.forEach((item, index) => {
const cartographic = Cesium.Cartographic.fromCartesian(
item // Cartesian3对象 {x, y, z}
);
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height;
posiArr.push({
lng: longitude,
lat: latitude,
alt: height
})
})
}
} else if (that.options.type == '线') {
that.options.positions.forEach(item => {
fromDegreesArray.push(item.lng, item.lat)
})
array = await that.linePoint(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
arr = array[0]
that.pointArr = arr
arr.forEach((item, index) => {
const cartographic = Cesium.Cartographic.fromCartesian(
item // Cartesian3对象 {x, y, z}
);
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height;
posiArr.push({
lng: longitude,
lat: latitude,
alt: height
if (that.options.positions.length != 0) {
that.options.positions.forEach(item => {
fromDegreesArray.push(item.lng, item.lat)
})
})
array = await that.linePoint(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
arr = array[0]
that.pointArr = arr
arr.forEach((item, index) => {
const cartographic = Cesium.Cartographic.fromCartesian(
item // Cartesian3对象 {x, y, z}
);
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height;
posiArr.push({
lng: longitude,
lat: latitude,
alt: height
})
})
}
} else if (that.options.type == '点') {
// let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
// posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: height }]
posiArr = [that.options.positions]
that.pointArr = posiArr
if (that.options.positions.lng) {
let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: height }]
// posiArr = [that.options.positions]
that.pointArr = posiArr
}
}
let params = {
type: that.options.type,

View File

@ -304,17 +304,17 @@ function html(that) {
</div>
</div>
</DIV-cy-tab-pane>-->
<DIV-cy-tab-pane label="灯光控制">
<div>
<div class="row">
<div class="col">
<span class="label" style="flex: unset;">指令</span>
<input class="input" type="text" @model="instruct">
<!-- <button class="btn" style="margin-left: 10px;" @click="instructSubmit">提交</button> -->
</div>
</div>
</div>
</DIV-cy-tab-pane>
<!-- <DIV-cy-tab-pane label="灯光控制">-->
<!-- <div>-->
<!-- <div class="row">-->
<!-- <div class="col">-->
<!-- <span class="label">指令</span>-->
<!-- <input class="input" type="text" @model="instruct">-->
<!-- <button class="primary" @click="instructSubmit">提交</button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </DIV-cy-tab-pane>-->
<!-- <DIV-cy-tab-pane label="设置操作点">-->
<!-- <div>-->
<!-- <div class="row">-->

View File

@ -48,64 +48,30 @@ class BillboardObject extends Base {
/**
* @constructor
* @description 点标注
* @param options {object} 属性
* @description 创建点标注
* @param sdk {object} sdk
* @param options {object} 标注参数
* @param options.id {string} 标注id
* @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 {object} options.positions 位置
* @param {number} options.positions.lng 经度
* @param {number} options.positions.lat 纬度
* @param {number} options.positions.alt 高
* @param {number} options.heightMode=3 高度模式0海拔高度1相对地表2依附地表; 3依附模型
* @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.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.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.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 [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 _Dialog {object} 弹框事件
*@param _Dialog.confirmCallBack {function} 弹框确认时的回调
*@param _Dialog.instructSubmit(id,name,instruct) {function} 提交指令ID, 名称,指令内容)
@ -175,8 +141,6 @@ class BillboardObject extends Base {
this.options.attribute.link.content || []
this.options.attribute.vr = this.options.attribute.vr || {}
this.options.attribute.vr.content = this.options.attribute.vr.content || []
this.options.attribute.rtmp = this.options.attribute.rtmp || {}
this.options.attribute.rtmp.content = this.options.attribute.rtmp.content || []
this.options.attribute.camera = this.options.attribute.camera || {}
this.options.attribute.camera.content =
this.options.attribute.camera.content || []
@ -234,7 +198,7 @@ class BillboardObject extends Base {
this.#_destroyMouseEvent = () => {
this.attributeElm && (this.attributeElm.style.pointerEvents = 'unset')
if (this.sdk && this.sdk.viewer && this.sdk.viewer._element) {
if(this.sdk && this.sdk.viewer && this.sdk.viewer._element) {
this.sdk.viewer._element.onmousemove = null
}
document.removeEventListener('mouseup', this.#_destroyMouseEvent)
@ -591,11 +555,6 @@ class BillboardObject extends Base {
value: '链接',
key: 'link'
},
{
name: 'rtmp',
value: 'rtmp',
key: 'rtmp'
},
{
name: 'IP摄像头',
value: 'IP摄像头',
@ -689,6 +648,7 @@ class BillboardObject extends Base {
return this.options.heightMode ? this.options.heightMode : 0
}
set heightMode(v) {
this.options.heightMode = v ? v : 0
this.options.heightMode = v || v == 0 ? v : 3
let heightMode
let heightModeName = ''
@ -745,7 +705,7 @@ class BillboardObject extends Base {
if (this.entity) {
this.entity.billboard.heightReference = heightMode
this.entity.label.heightReference = heightMode
if (heightMode == Cesium.HeightReference.CLAMP_TO_GROUND) {
if(heightMode == Cesium.HeightReference.CLAMP_TO_GROUND) {
if (this.sdk.viewer.scene.terrainProvider.availability) {
Cesium.sampleTerrainMostDetailed(
this.sdk.viewer.scene.terrainProvider,
@ -1710,170 +1670,6 @@ class BillboardObject extends Base {
}
}
get attributeRtmp() {
return this.options.attribute.rtmp.content
}
set attributeRtmp(v) {
this.options.attribute.rtmp.content = v
if (
!this._DialogObject ||
!this._DialogObject._element ||
!this._DialogObject._element.content ||
this._DialogObject._element.content.getElementsByClassName(
'attribute-content-rtmp'
).length == 0
) {
return
}
let table = this._DialogObject._element.content
.getElementsByClassName('attribute-content-rtmp')[1]
.getElementsByClassName('table')[0]
let tableContent = table.getElementsByClassName('table-body')[0]
tableContent.innerHTML = ''
if (this.options.attribute.rtmp.content.length > 0) {
table.getElementsByClassName('table-empty')[0].style.display = 'none'
} else {
table.getElementsByClassName('table-empty')[0].style.display = 'flex'
}
for (let i = 0; i < this.options.attribute.rtmp.content.length; i++) {
let tr =
`
<div class="tr">
<div class="td">` +
this.options.attribute.rtmp.content[i].name +
`</div>
<div class="td">` +
this.options.attribute.rtmp.content[i].url +
`</div>
<div class="td">
<button @click="rtmpEdit">编辑</button>
<button @click="rtmpDelete">删除</button>
</div>
</div>`
let trElm = document.createRange().createContextualFragment(tr)
tableContent.appendChild(trElm)
}
let item = tableContent.getElementsByClassName('tr')
let fun = {
rtmpEdit: async index => {
this.attributeRtmp = await this.options.attribute.rtmp.content
let table = this._DialogObject._element.content
.getElementsByClassName('attribute-content-rtmp')[1]
.getElementsByClassName('table')[0]
let tableContent = table.getElementsByClassName('table-body')[0]
let item = tableContent.getElementsByClassName('tr')
for (let i = 0; i < item.length; i++) {
if (index === i) {
let height = item[i].offsetHeight
let html = `
<div class="td">
<input class="input" type="text">
</div>
<div class="td">
<textarea class="input link-edit" type="text"></textarea>
</div>
<div class="td">
<button @click="confirmEdit">确认</button>
<button @click="cancelEdit">取消</button>
</div>`
item[i].innerHTML = html
let textareaElm = item[i].getElementsByClassName('link-edit')[0]
textareaElm.style.height = height - 10 + 'px'
let td = item[i].getElementsByClassName('td')
td[0].getElementsByClassName(
'input'
)[0].value = this.options.attribute.rtmp.content[index].name
td[1].getElementsByClassName(
'input'
)[0].value = this.options.attribute.rtmp.content[index].url
let btn = item[i].getElementsByTagName('button')
for (let n = 0; n < btn.length; n++) {
if (!btn[n] || !btn[n].attributes) {
continue
}
for (let m of btn[n].attributes) {
if (m.name === '@click') {
btn[n].addEventListener('click', e => {
if (typeof fun[m.value] === 'function') {
fun[m.value](
{
id: this.options.attribute.rtmp.content[index].id,
name: td[0].getElementsByClassName('input')[0].value,
url: td[1].getElementsByClassName('input')[0].value
},
i
)
}
})
btn[n].attributes.removeNamedItem(m.name)
break
}
}
}
break
}
}
},
rtmpDelete: i => {
this.options.attribute.rtmp.content.splice(i, 1)
this.attributeRtmp = this.options.attribute.rtmp.content
},
confirmEdit: (value, i) => {
let name = value.name && value.name.replace(/\s/g, '')
let url = value.url && value.url.replace(/\s/g, '')
if (name && url) {
this.options.attribute.rtmp.content[i] = value
} else {
window.ELEMENT &&
window.ELEMENT.Message({
message: '名称或链接不能为空!',
type: 'warning',
duration: 1500
})
}
this.attributeRtmp = this.options.attribute.rtmp.content
},
cancelEdit: () => {
this.attributeRtmp = this.options.attribute.rtmp.content
},
fileSelect: (value, i) => {
let fileElm = item[i].getElementsByClassName('file-select')[0]
fileElm.click()
fileElm.removeEventListener('change', fileSelect)
fileElm.addEventListener('change', fileSelect)
}
}
let fileSelect = event => {
if (event.target.value) {
let td = item[
event.target.getAttribute('index')
].getElementsByClassName('td')
td[1].getElementsByClassName('input')[0].value = event.target.value
event.target.value = null
}
}
for (let i = 0; i < item.length; i++) {
let btn = item[i].getElementsByTagName('button')
for (let n = 0; n < btn.length; n++) {
if (!btn[n] || !btn[n].attributes) {
continue
}
for (let m of btn[n].attributes) {
if (m.name === '@click') {
btn[n].addEventListener('click', e => {
if (typeof fun[m.value] === 'function') {
fun[m.value](i)
}
})
btn[n].attributes.removeNamedItem(m.name)
break
}
}
}
}
}
get attributeGoods() {
return this.options.attribute.goods.content
}
@ -1968,9 +1764,6 @@ class BillboardObject extends Base {
this.labelText = '未命名对象'
}
this.originalOptions = this.deepCopyObj(this.options)
this.previous = {
positions: { ...this.options.positions }
}
this._DialogObject.close()
let cdoptions = this.deepCopyObj(this.options)
cdoptions.host = ''
@ -2083,7 +1876,6 @@ class BillboardObject extends Base {
setTimeout(async () => {
this.attributeLink = this.options.attribute.link.content
this.attributeVr = this.options.attribute.vr.content
this.attributeRtmp = this.options.attribute.rtmp.content
// this.attributeCamera = this.options.attribute.camera
this.cameraSelect && this.cameraSelect()
this.ISCSelect && this.ISCSelect()
@ -2266,7 +2058,7 @@ class BillboardObject extends Base {
switch (heightMode) {
case 0:
case '0':
heightElm.value = this.alt
this.alt = Number(heightElm.value)
heightBoxElm.style.display = 'flex'
this.heightMode = 0
break
@ -2282,10 +2074,12 @@ class BillboardObject extends Base {
)
]
).then(position => {
heightElm.value = Math.floor((this.alt - position[0].height) * 100) / 100
this.alt =
Number(heightElm.value) +
Number(position[0].height.toFixed(2))
})
} else {
heightElm.value = 0
this.alt = Number(heightElm.value)
}
heightBoxElm.style.display = 'flex'
this.heightMode = 1
@ -2610,7 +2404,6 @@ class BillboardObject extends Base {
this.operatingPoint = this.originalOptions.operatingPoint
this.attributeLink = this.options.attribute.link.content
this.attributeVr = this.options.attribute.vr.content
this.attributeRtmp = this.options.attribute.rtmp.content
this.attributeCamera = this.options.attribute.camera.content
this.attributeGoods = this.options.attribute.goods.content
this.attributeISC = this.options.attribute.ISC.content
@ -2730,35 +2523,6 @@ class BillboardObject extends Base {
})
this.attributeVr = this.options.attribute.vr.content
}
_addRtmp() {
if (
this._DialogObject._element.content.getElementsByClassName('rtmp_add')[0]
.value
) {
this.options.attribute.rtmp.content.push({
id: Date.now(),
name: '地址',
url: this._DialogObject._element.content.getElementsByClassName(
'rtmp_add'
)[0].value
})
this._DialogObject._element.content.getElementsByClassName(
'rtmp_add'
)[0].value = ''
this.attributeRtmp = this.options.attribute.rtmp.content
} else {
this.Dialog.clickAddRtmp && this.Dialog.clickAddRtmp()
}
}
addAttributeRtmp(rtmp) {
this.options.attribute.rtmp.content.push({
id: Date.now(),
name: '地址',
url: rtmp
})
this.attributeRtmp = this.options.attribute.rtmp.content
}
/**
* 打开富文本框
@ -2871,7 +2635,9 @@ class BillboardObject extends Base {
)
]
).then(position => {
heightElm.value = Math.floor((this.alt - position[0].height) * 100) / 100
heightElm.value = Number(
(this.options.positions.alt - position[0].height).toFixed(2)
)
this.#_billboardHeight = this.options.positions.alt
})
} else {
@ -3180,7 +2946,7 @@ class BillboardObject extends Base {
attributeElm.style.left = '0px'
attributeElm.style.width = 0
attributeElm.style.height = 0
if (getState()) {
if(getState()) {
attributeElm.style.display = 'none'
}
// attributeElm.innerHTML = this.options.richTextContent
@ -3189,13 +2955,7 @@ class BillboardObject extends Base {
let goodsHtml = ''
let richTextHtml = ''
for (let i = 0; i < this.options.attribute.link.content.length; i++) {
const match = this.options.attribute.link.content[i].url.match(/\.([^.?#]+)(?=\?|#|$)/);
if(match && (match[1] === 'pdf' || match[1] === 'PDF')) {
linkHtml += `<DIV-cy-tab-pane label="${this.options.attribute.link.content[i].name}"><embed width='100%' height='100%' src="${this.options.attribute.link.content[i].url}" type="application/pdf"></embed></DIV-cy-tab-pane>`
}
else {
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}" sandbox="allow-scripts allow-same-origin"></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="物资">

View File

@ -21,53 +21,23 @@ 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=[]] {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} 高度
* @param options.circle=[{radius, color}] {object} 圆属性radius:半径color:颜色
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
*/
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
@ -460,6 +430,15 @@ 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
}
@ -1038,9 +1017,9 @@ class CircleDiffuse extends Base {
else if (this.options.positions) {
position = { ...this.options.positions[0] }
}
// else if (this.options.center) {
// position = { ...this.options.center }
// }
else if (this.options.center) {
position = { ...this.options.center }
}
else if (this.options.start) {
position = { ...this.options.start }
}

View File

@ -18,63 +18,22 @@ 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 {number} 经度
* @param options.center.lat {number} 纬度
* @param options.center.alt {number} 高度
* @param options.radius=10 {number}半径
* @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.line {object} 边框
* @param options.line.width=3 {number} 边框宽
* @param options.line.width=2 {string} 边框宽
* @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);
@ -1991,7 +1950,7 @@ class CircleObject extends Base {
return '半径:' + moveRadius + ' 米'
}, false),
font: '20px Microsoft YaHei',
disableDepthTestDistance: Number.POSITIVE_INFINITY,
distanceDisplayCondition: 10000000,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,

View File

@ -21,57 +21,30 @@ 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=2{number} 高度模式0海拔高度1相对高度2依附模式
* @param options.noseToTail=false {boolean} 首尾相连
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
* @param options.heightMode{number} 高度模式0海拔高度1相对高度2依附模式
* @param options['nose-to-tail']=false {boolean} 首尾相连
* @param options.extend=false {boolean} 线缓冲
* @param options.extendWidth=10 {number} 线缓冲宽度
* @param options.extendColor=rgba(255,255,80,0.3) {number} 线缓冲颜色
* @param options['extend-width']=10 {number} 线缓冲宽度
* @param options['extend-color']=#ffde00 {number} 线缓冲颜色
* @param options.show=true {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 {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 _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
@ -83,7 +56,7 @@ class CurvelineObject extends Base {
this.options.type = options.type ? Number(options.type) : 0
this.options['nose-to-tail'] = options['nose-to-tail'] || false
this.options.extend = options.extend || false
this.options.rotate = (options.rotate || options.rotate === false) ? options.rotate : true
this.options.rotate = options.rotate || true
this.options.space = options.space || 1
this.options.speed = options.speed || 10
this.options.dashSize = options.dashSize || 0.03
@ -241,9 +214,7 @@ class CurvelineObject extends Base {
})
this.options.rotate = v
let params = { ...this.options }
params.speed = this.inputSpeed
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params)
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
}
get space() {
@ -377,10 +348,9 @@ class CurvelineObject extends Base {
this._elms.lineWidth.forEach(item => {
item.value = this.options.width
})
if (this.entity && this.entity.polyline) {
this.entity.polyline.width = this.entity.polyline.width + v - this.entity.polyline.oriWidth
this.entity.polyline.oriWidth = this.options.width
}
this.entity &&
this.entity.polyline &&
(this.entity.polyline.width = this.options.width)
}
get lineType() {
@ -698,13 +668,13 @@ class CurvelineObject extends Base {
this.options.label.show = v
if (this.show && !this.showView || this.showView == 3) {
this.label.show = v
// setTimeout(() => {
// this.label.position = [
// this.options.positions[0].lng,
// this.options.positions[0].lat,
// this.options.positions[0].alt
// ]
// }, 0)
setTimeout(() => {
this.label.position = [
this.options.positions[0].lng,
this.options.positions[0].lat,
this.options.positions[0].alt
]
}, 0)
} else {
this.label.show = false
}
@ -1646,7 +1616,7 @@ class CurvelineObject extends Base {
// 创建标签页
let tabsElm = new cy_tabs(
'polyline-object-edit-tabs',
tabClick,
undefined,
this.sdk
)
// 颜色组件

View File

@ -18,13 +18,12 @@ 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} 维度
@ -34,41 +33,8 @@ 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);

View File

@ -13,15 +13,6 @@ 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);

View File

@ -47,15 +47,9 @@ class FlowLine extends Base {
this._elms = {};
this.positionArea = []
this.positions = []
if (!this.options.positions || this.options.positions.length < 3) {
this._error = '最少需要绘制三个坐标!'
console.warn(this._error)
}
else {
this.sdk.addIncetance(this.options.id, this)
// FlowLine.create(this)
FlowLine.drawLine(this)
}
this.sdk.addIncetance(this.options.id, this)
// FlowLine.create(this)
FlowLine.drawLine(this)
}
// 创建水面

View File

@ -9,25 +9,6 @@ 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()

View File

@ -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} 资源地址
* @param options.url {string} svg图片地址
* @param options.flipe {object} 翻转
* @param options.flipe.x=false {boolean} 绕X轴翻转
* @param options.flipe.y=false {boolean} 绕Y轴翻转
@ -34,31 +34,8 @@ class GroundSvg extends Base {
* @param options.position.lng {number} 经度
* @param options.position.lat {number} 纬度
* @param options.color {string} 颜色
* @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} 高度
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
#loadEvent = void 0
#loaded = false

View File

@ -69,7 +69,7 @@ class LabelObject extends Base {
let id = this.options.id + '-label'
let oldEntity = this.sdk.viewer.entities.getById(id)
if (oldEntity) {
if(oldEntity) {
this.sdk.viewer.entities.remove(oldEntity)
}
this.entity = this.sdk.viewer.entities.add({
@ -231,27 +231,31 @@ class LabelObject extends Base {
if (this.model.customScale.z > scale) {
scale = this.model.customScale.z
}
let pos = this.cartesian3Towgs84(this.model.position, this.sdk.viewer)
let point1 = Cesium.Cartesian3.fromDegrees(
pos.lng,
pos.lat,
pos.alt +
this.options.position[0],
this.options.position[1],
this.options.position[2] +
(this.model.originalBoundingSphereRadius || 1) *
2 *
(scale || 0.01)
)
// 计算该点在椭球面上的法线方向(垂直于地面的方向)
const ellipsoid = Cesium.Ellipsoid.WGS84;
const normal = ellipsoid.geodeticSurfaceNormal(point1);
let c = Cesium.Cartesian3.normalize(normal, normal)
const direction = Cesium.Cartesian3.multiplyByScalar(
c,
-1,
new Cesium.Cartesian3() // 用于存储结果的新对象
);
let ray = new Cesium.Ray(point1, direction)
// 点2的位置也使用经纬高表示
let point2 = Cesium.Cartesian3.fromDegrees(
this.options.position[0],
this.options.position[1],
this.options.position[2] -
(this.model.originalBoundingSphereRadius || 1) *
2 *
(scale || 0.01)
)
let direction = Cesium.Cartesian3.subtract(
point2,
point1,
new Cesium.Cartesian3()
)
let c = Cesium.Cartesian3.normalize(direction, direction)
let ray = new Cesium.Ray(point1, c)
let pickedObjects = this.viewer.scene.drillPickFromRay(ray, 5)
for (let i = 0; i < pickedObjects.length; i++) {
if (
pickedObjects[i].object &&
@ -436,12 +440,12 @@ class LabelObject extends Base {
this.updateBillboardImage()
}
updateBillboardImage() {
// this.entity.billboard.image = this.getcanvas()
clearTimeout(this.#updateBillboardImageTimeout)
this.#updateBillboardImageTimeout = setTimeout(() => {
clearTimeout(this.#updateBillboardImageTimeout)
this.entity.billboard.image = this.getcanvas()
}, 500)
this.entity.billboard.image = this.getcanvas()
// clearTimeout(this.#updateBillboardImageTimeout)
// this.#updateBillboardImageTimeout = setTimeout(() => {
// clearTimeout(this.#updateBillboardImageTimeout)
// this.entity.billboard.image = this.getcanvas()
// }, 500)
}
get lineColor() {
return this.options.pixelOffset

View File

@ -1,466 +0,0 @@
/**
* 标注
*/
import Base from '../index'
import MouseEvent from '../../../Event/index'
import {
getGroundCover
} from '../../../Global/global'
import { getFontFamily } from '../../Element/fontSelect'
import {
addCluster,
remove_entity_from_cluster
} from '../../../Global/cluster/cluster'
class LabelObject extends Base {
constructor(sdk, options = {}, model) {
super(sdk, options)
this.model = model
this.options.near = options.near || options.near === 0 ? options.near : 2000
this.options.far = options.far || options.far === 0 ? options.far : 100000
this.options.scaleByDistance = options.scaleByDistance || false
this.options.show =
options.show || options.show === false ? options.show : true
this.options.text = options.text
let textArray = this.options.text.split('\n')
for (let i = 0; i < textArray.length; i++) {
if (textArray[i].length > 40) {
textArray[i] = textArray[i].slice(0, 40 - textArray[i].length)
}
}
if (textArray.length > 10) {
textArray.splice(10 - textArray.length)
}
this.options.text = textArray.join('\n')
this.options.fontFamily = options.fontFamily || 0
this.font = getFontFamily(this.options.fontFamily) || 'SimHei'
this.options.fontSize = options.fontSize || 20
this.options.lineColor = options.lineColor || '#00ffff80'
this.options.color = options.color || '#ffffff'
this.options.ground =
options.ground || options.ground === false ? options.ground : true
this.options.pixelOffset =
options.pixelOffset || options.pixelOffset === 0
? options.pixelOffset
: 20
this.options.backgroundColor = options.backgroundColor || [
'#00ffff80',
'#00ffff80'
]
this.event = new MouseEvent(this.sdk)
this.entity
this.create(this.options.position)
this.picking = true
}
async create() {
let _this = this
if (!this.options.position[2] && this.options.position[2] !== 0) {
this.options.position[2] = await this.getClampToHeight({
lng: this.options.position[0],
lat: this.options.position[1]
})
}
this.originalOptions = copyObj(this.options)
let id = this.options.id + '-label'
let oldEntity = this.sdk.viewer.entities.getById(id)
if(oldEntity) {
this.sdk.viewer.entities.remove(oldEntity)
}
this.entity = this.sdk.viewer.entities.add({
show: this.options.show,
id: this.options.id + '-label',
position: new Cesium.CallbackProperty(function () {
if (_this.model) {
// return Cesium.Cartesian3.fromDegrees(_this.options.position[0], _this.options.position[1], _this.model.originalBoundingSphereRadius*2*_this.model.customScale.z + _this.options.position[2])
if (_this.model.isMove) {
let scale = _this.model.customScale.x
if (_this.model.customScale.y > scale) {
scale = _this.model.customScale.y
}
if (_this.model.customScale.z > scale) {
scale = _this.model.customScale.z
}
let point1 = Cesium.Cartesian3.fromDegrees(
_this.options.position[0],
_this.options.position[1],
_this.options.position[2] +
(_this.model.originalBoundingSphereRadius || 1) *
2 *
(scale || 0.01)
)
// 点2的位置也使用经纬高表示
let point2 = Cesium.Cartesian3.fromDegrees(
_this.options.position[0],
_this.options.position[1],
_this.options.position[2] -
(_this.model.originalBoundingSphereRadius || 1) *
2 *
(scale || 0.01)
)
let direction = Cesium.Cartesian3.subtract(
point2,
point1,
new Cesium.Cartesian3()
)
let c = Cesium.Cartesian3.normalize(direction, direction)
let ray = new Cesium.Ray(point1, c)
let pickedObjects = _this.viewer.scene.drillPickFromRay(ray, 5)
for (let i = 0; i < pickedObjects.length; i++) {
if (
pickedObjects[i].object &&
pickedObjects[i].object.id &&
pickedObjects[i].object.id === _this.model.id
) {
let pos84 = _this.cartesian3Towgs84(pickedObjects[i].position, _this.sdk.viewer)
_this.options.position[0] = pos84.lng
_this.options.position[1] = pos84.lat
_this.options.position[2] = pos84.alt
break
}
}
}
return Cesium.Cartesian3.fromDegrees(
_this.options.position[0],
_this.options.position[1],
_this.options.position[2]
)
} else {
return Cesium.Cartesian3.fromDegrees(..._this.options.position)
}
}, false),
// billboard: {
// image: this.getcanvas(),
// verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
// disableDepthTestDistance: new Cesium.CallbackProperty(function () {
// return getGroundCover() ? undefined : Number.POSITIVE_INFINITY
// }, false),
// scaleByDistance: this.options.scaleByDistance
// ? new Cesium.NearFarScalar(this.options.near, 1, this.options.far, 0)
// : undefined,
// pixelOffsetScaleByDistance: this.options.scaleByDistance
// ? new Cesium.NearFarScalar(this.options.near, 1, this.options.far, 0)
// : undefined
// },
label: {
text: new Cesium.CallbackProperty(function () {
return _this.options.text
}, false),
font: this.options.fontSize + "px " + this.font,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance: new Cesium.CallbackProperty(function () {
return getGroundCover() ? undefined : Number.POSITIVE_INFINITY
}, false),
scaleByDistance: this.options.scaleByDistance
? new Cesium.NearFarScalar(this.options.near, 1, this.options.far, 0)
: undefined,
pixelOffsetScaleByDistance: this.options.scaleByDistance
? new Cesium.NearFarScalar(this.options.near, 1, this.options.far, 0)
: undefined,
fillColor: Cesium.Color.fromCssColorString(this.options.color),
backgroundColor: Cesium.Color.fromCssColorString('#6e6e6e'),
backgroundPadding: new Cesium.Cartesian2(10, 10),
showBackground: true,
outlineWidth: 0,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
},
})
}
get position() {
return this.options.position
}
set position(v) {
// console.log(v)
this.options.position = v
if (!v[2] && v[2] !== 0) {
let objectsToExclude = [...this.sdk.viewer.entities.values]
this.getClampToHeight({
lng: v[0],
lat: v[1]
}, objectsToExclude).then(height => {
v[2] = height
this.options.position = [...v]
})
// let point1 = Cesium.Cartesian3.fromDegrees(this.options.position[0], this.options.position[1], 0);
// let point2 = Cesium.Cartesian3.fromDegrees(this.options.position[0], this.options.position[1], 10000000);
// let direction = Cesium.Cartesian3.subtract(point2, point1, new Cesium.Cartesian3());
// let c = Cesium.Cartesian3.normalize(direction, direction);
// let ray = new Cesium.Ray(point1, c);
// let r = {}
// let pickedObjects = this.sdk.viewer.scene.drillPickFromRay(ray);
// for (let i = 0; i < pickedObjects.length; i++) {
// if (pickedObjects[i].position) {
// r = pickedObjects[i]
// break
// }
// }
// if (r && r.position) {
// this.options.position[2] = this.cartesian3Towgs84(r.position, this.sdk.viewer).alt
// }
// else {
// try {
// let promise = Cesium.sampleTerrainMostDetailed(this.sdk.viewer.terrainProvider, [Cesium.Cartographic.fromDegrees(this.options.position[0], this.options.position[1])]);
// promise.then((p) => {
// this.options.position[2] = p[0].height
// }).catch((e)=>{
// })
// } catch (error) {
// }
// }
} else {
this.options.position = [...v]
}
}
get show() {
return this.options.show
}
set show(v) {
this.options.show = v
if (!this.entity) {
return
}
this.entity.show = v
if (this.model) {
// return Cesium.Cartesian3.fromDegrees(this.options.position[0], this.options.position[1], this.model.originalBoundingSphereRadius*2*this.model.customScale.z + this.options.position[2])
let scale = this.model.customScale.x
if (this.model.customScale.y > scale) {
scale = this.model.customScale.y
}
if (this.model.customScale.z > scale) {
scale = this.model.customScale.z
}
let point1 = Cesium.Cartesian3.fromDegrees(
this.options.position[0],
this.options.position[1],
this.options.position[2] +
(this.model.originalBoundingSphereRadius || 1) *
2 *
(scale || 0.01)
)
// 点2的位置也使用经纬高表示
let point2 = Cesium.Cartesian3.fromDegrees(
this.options.position[0],
this.options.position[1],
this.options.position[2] -
(this.model.originalBoundingSphereRadius || 1) *
2 *
(scale || 0.01)
)
let direction = Cesium.Cartesian3.subtract(
point2,
point1,
new Cesium.Cartesian3()
)
let c = Cesium.Cartesian3.normalize(direction, direction)
let ray = new Cesium.Ray(point1, c)
let pickedObjects = this.viewer.scene.drillPickFromRay(ray, 5)
for (let i = 0; i < pickedObjects.length; i++) {
if (
pickedObjects[i].object &&
pickedObjects[i].object.id &&
pickedObjects[i].object.id === this.model.id
) {
let pos84 = this.cartesian3Towgs84(pickedObjects[i].position, this.sdk.viewer)
this.options.position[0] = pos84.lng
this.options.position[1] = pos84.lat
this.options.position[2] = pos84.alt
break
}
}
}
else if (this.options.ground) {
let objectsToExclude = [...this.sdk.viewer.entities.values]
this.getClampToHeight({
lng: this.options.position[0],
lat: this.options.position[1]
}, objectsToExclude).then(height => {
this.options.position[2] = height
})
}
}
get text() {
return this.options.text
}
set text(v) {
this.options.text = v
let textArray = this.options.text.split('\n')
for (let i = 0; i < textArray.length; i++) {
if (textArray[i].length > 40) {
textArray[i] = textArray[i].slice(0, 40 - textArray[i].length)
}
}
if (textArray.length > 10) {
textArray.splice(10 - textArray.length)
}
this.options.text = textArray.join('\n')
}
get color() {
return this.options.color
}
set color(v) {
this.options.color = v
this.entity.label.fillColor = Cesium.Color.fromCssColorString(this.options.color)
}
get scaleByDistance() {
return this.options.scaleByDistance
}
set scaleByDistance(v) {
this.options.scaleByDistance = v
if (!this.entity) {
return
}
if (this.options.scaleByDistance) {
this.entity.label.scaleByDistance = new Cesium.NearFarScalar(
this.options.near,
1,
this.options.far,
0
)
this.entity.label.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(
this.options.near,
1,
this.options.far,
0
)
} else {
this.entity.label.scaleByDistance = undefined
this.entity.label.pixelOffsetScaleByDistance = undefined
}
}
get near() {
return this.options.near
}
set near(v) {
let near = v
if (near > this.far) {
near = this.far
}
this.options.near = near
if (!this.entity) {
return
}
if (this.options.scaleByDistance) {
this.entity.label.scaleByDistance = new Cesium.NearFarScalar(
this.options.near,
1,
this.options.far,
0
)
this.entity.label.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(
this.options.near,
1,
this.options.far,
0
)
} else {
this.entity.label.scaleByDistance = undefined
this.entity.label.pixelOffsetScaleByDistance = undefined
}
}
get far() {
return this.options.far
}
set far(v) {
let far = v
if (far < this.near) {
far = this.near
}
this.options.far = far
if (!this.entity) {
return
}
if (this.options.scaleByDistance) {
this.entity.label.scaleByDistance = new Cesium.NearFarScalar(
this.options.near,
1,
this.options.far,
0
)
this.entity.label.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(
this.options.near,
1,
this.options.far,
0
)
} else {
this.entity.label.scaleByDistance = undefined
this.entity.label.pixelOffsetScaleByDistance = undefined
}
}
get fontSize() {
return this.options.fontSize
}
set fontSize(v) {
this.options.fontSize = Number(v)
if (!this.entity) {
return
}
this.entity.label.font = this.options.fontSize + "px " + this.font
}
get fontFamily() {
return this.options.fontFamily
}
set fontFamily(v) {
this.options.fontFamily = v || 0
this.font = getFontFamily(this.options.fontFamily) || 'SimHei'
this.entity.label.font = this.options.fontSize + "px " + this.font
}
get ground() {
return this.options.ground
}
set ground(v) {
this.options.ground = v
}
// get backgroundColorStart() {
// return this.options.backgroundColor[0]
// }
// set backgroundColorStart(v) {
// this.options.backgroundColor[0] = v
// this.entity.billboard.image = this.getcanvas()
// }
// get backgroundColorEnd() {
// return this.options.backgroundColor[1]
// }
// set backgroundColorEnd(v) {
// this.options.backgroundColor[1] = v
// this.entity.billboard.image = this.getcanvas()
// }
remove() {
this.sdk.viewer.entities.remove(this.entity)
this.entity = null
}
flicker() { }
}
export default LabelObject
const copyObj = (obj = {}) => {
//变量先置空
let newobj = null
//判断是否需要继续进行递归
if (typeof obj == 'object' && obj !== null) {
newobj = obj instanceof Array ? [] : {} //进行下一层递归克隆
for (var i in obj) {
newobj[i] = copyObj(obj[i])
} //如果不是对象直接赋值
} else newobj = obj
return newobj
}

View File

@ -18,10 +18,9 @@ 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} 贴图地址
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
* @param options.startColor="#ff0000" {string} 起始颜色
* @param options.endColor="#fff000" {string} 结束颜色
* @param options.startScale=0.5 {number} 初始比例
@ -35,15 +34,8 @@ class Flame extends Base {
* @param options.lng 经度
* @param options.lat 纬度
* @param options.alt 高度
* @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} 弹框确认时的回调
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);

View File

@ -17,10 +17,9 @@ 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} 贴图地址
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
* @param options.startColor="#c1f7f24d" {string} 起始颜色
* @param options.endColor="#ffffff00" {string} 结束颜色
* @param options.startScale=1 {number} 初始比例
@ -31,18 +30,12 @@ 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 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} 弹框确认时的回调
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);
@ -57,7 +50,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

View File

@ -17,10 +17,9 @@ 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} 贴图地址
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
* @param options.startColor="#00000000" {string} 起始颜色
* @param options.endColor="#0000001a" {string} 结束颜色
* @param options.startScale=0.1 {number} 初始比例
@ -34,15 +33,8 @@ class Smoke extends Base {
* @param options.lng 经度
* @param options.lat 纬度
* @param options.alt 高度
* @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} 弹框确认时的回调
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);

View File

@ -16,10 +16,9 @@ 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} 贴图地址
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
* @param options.startColor="#c1f7f2" {string} 起始颜色
* @param options.endColor="#ffffff00" {string} 结束颜色
* @param options.startScale=0.2 {number} 初始比例
@ -29,8 +28,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 纬度
@ -39,15 +38,8 @@ class Spout extends Base {
* @param options.end.lng 经度
* @param options.end.lat 纬度
* @param options.end.alt 高度
* @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} 弹框确认时的回调
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);

View File

@ -22,56 +22,14 @@ 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='rgba(255, 0, 0, 0.5)' {string} 颜色
* @param options.color="#ff000080" {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 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} 高度
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);

View File

@ -1837,7 +1837,7 @@ class PolygonObject extends Base {
)[0].value
) {
this.options.attribute.vr.content.push({
name: '全景图',
name: '全景图' ,
url: this._DialogObject._element.content.getElementsByClassName(
'vr_add'
)[0].value
@ -1853,7 +1853,7 @@ class PolygonObject extends Base {
addAttributeRr(vr) {
this.options.attribute.vr.content.push({
name: '全景图',
name: '全景图' ,
url: vr
})
this.attributeVr = this.options.attribute.vr.content
@ -2236,7 +2236,6 @@ class PolygonObject extends Base {
static nodeEdit(that, cb = () => { }) {
that.positionEditing = false
setTimeout(() => {
let previous = [...that.options.positions]
if (YJ.Measure.GetMeasureStatus()) {
cb('上一次测量未结束')
} else {
@ -2299,9 +2298,6 @@ class PolygonObject extends Base {
that.positions = Cesium.Cartesian3.fromDegreesArray(
fromDegreesArray
)
that.previous = {
positions: [...that.positions]
}
newpositions = Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)
let objectsToExclude = [...that.sdk.viewer.entities.values]
@ -2393,77 +2389,6 @@ class PolygonObject extends Base {
if (added) {
that.options.positions.splice(selectPoint.index, 1)
}
if (that.options.positions.length < 3) {
console.warn('多边形最少需要三个坐标!')
window.ELEMENT &&
window.ELEMENT.Message({
message: '多边形最少需要三个坐标!',
type: 'warning',
duration: 1500
})
that.options.positions = [...previous]
let positions = that.options.positions
let fromDegreesArray = []
for (let i = 0; i < positions.length; i++) {
fromDegreesArray.push(positions[i].lng, positions[i].lat)
}
that.positions = Cesium.Cartesian3.fromDegreesArray(
fromDegreesArray
)
newpositions = Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)
that.previous = {
positions: [...that.positions]
}
let objectsToExclude = [...that.sdk.viewer.entities.values]
let positions2 = [[]]
for (let i = 0; i < that.options.positions.length; i++) {
positions2[0].push([
that.options.positions[i].lng,
that.options.positions[i].lat
])
}
positions2[0].push([
that.options.positions[0].lng,
that.options.positions[0].lat
])
let polygon = turf.polygon(positions2)
let centroid = turf.centroid(polygon)
that
.getClampToHeight({
lng: centroid.geometry.coordinates[0],
lat: centroid.geometry.coordinates[1]
}, objectsToExclude)
.then(height => {
that.label.position = [
centroid.geometry.coordinates[0],
centroid.geometry.coordinates[1],
height
]
})
that.options.areaByMeter = that.computeArea(that.options.positions)
switch (that.options['area-unit']) {
case '平方米':
that.area = that.options.areaByMeter
break
case '平方千米':
that.area = Number(
(that.options.areaByMeter / 1000000).toFixed(8)
)
break
case '亩':
that.area = Number(
(that.options.areaByMeter / 666.6666667).toFixed(4)
)
break
case '公顷':
that.area = Number((that.options.areaByMeter / 10000).toFixed(6))
break
default:
that.area = that.options.areaByMeter
}
}
cb(null, that.options.positions)
}

View File

@ -26,44 +26,9 @@ class PolyhedronObject extends Base {
* @param options.name {string} 名称
* @param options.color="#ff0000" {string} 颜色
* @param options.height=10 {number} 高
* @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} 高度
* @param {Array.<object>} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);
@ -1468,7 +1433,6 @@ class PolyhedronObject extends Base {
let originalPosition
let added = false
let previous = [...that.options.positions]
let leftEvent = (movement, cartesian) => {
if (selectPoint) {
that.options.positions[selectPoint.index] = that.cartesian3Towgs84(cartesian, that.sdk.viewer)
@ -1532,25 +1496,6 @@ class PolyhedronObject extends Base {
if(added) {
that.options.positions.splice(selectPoint.index, 1)
}
if (!that.options.positions || that.options.positions.length < 3) {
console.warn('多面体最少需要三个坐标!')
window.ELEMENT && window.ELEMENT.Message({
message: '多面体最少需要三个坐标!',
type: 'warning',
duration: 1500
});
that.options.positions = [...previous]
}
let labelPositions = [[]]
for (let i = 0; i < that.options.positions.length; i++) {
labelPositions[0].push([that.options.positions[i].lng, that.options.positions[i].lat])
}
labelPositions[0].push([that.options.positions[0].lng, that.options.positions[0].lat])
if (labelPositions[0].length >= 4) {
let polygon = turf.polygon(labelPositions);
let centroid = turf.centroid(polygon);
that.label.position = [centroid.geometry.coordinates[0], centroid.geometry.coordinates[1], that.options.height + that.options.extrudedHeight]
}
that.options.areaByMeter = that.computeArea(that.options.positions);
switch (that.options['area-unit']) {
case '平方米':

View File

@ -25,46 +25,28 @@ class PolylineObject extends Base {
* @description 折线
* @param options {object} 线属性
* @param options.name{string} 名称
* @param options.width=3{number} 线宽
* @param options.width * @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.noseToTail=false {boolean} 首尾相连
* @param options['nose-to-tail']=false {boolean} 首尾相连
* @param options.smooth=false {boolean} 线段圆滑
* @param options.extend=false {boolean} 线缓冲
* @param options.extendWidth=10 {number} 线缓冲宽度
* @param options.extendColor=rgba(255,255,80,0.3) {number} 线缓冲颜色
* @param options['extend-width']=10 {number} 线缓冲宽度
* @param options['extend-color']=rgba(255,255,80,0.3) {number} 线缓冲颜色
* @param options.show=true {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 {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 _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
@ -77,7 +59,7 @@ class PolylineObject extends Base {
this.options['nose-to-tail'] = options['nose-to-tail'] || false
this.options.smooth = options.smooth || false
this.options.extend = options.extend || false
this.options.rotate = (options.rotate || options.rotate === false) ? options.rotate : true
this.options.rotate = options.rotate || true
this.options.space = options.space || 1
this.options.speed = options.speed || 10
this.options.dashSize = options.dashSize || 0.03

View File

@ -20,44 +20,14 @@ 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=#FFEB3B {string} 颜色
* @param options.color=#1FA8E3 {string} 颜色
* @param options.radius=10 {number} 半径
* @param options.speed=20 {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} 视野缩放最远距离
* @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} 弹框确认时的回调
*/
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);
@ -1065,9 +1035,9 @@ class RadarScan extends Base {
else if (this.options.positions) {
position = { ...this.options.positions[0] }
}
// else if (this.options.center) {
// position = { ...this.options.center }
// }
else if (this.options.center) {
position = { ...this.options.center }
}
else if (this.options.start) {
position = { ...this.options.start }
}

View File

@ -23,46 +23,16 @@ 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=rgba(255,255,0,0.3){string} 范围颜色
* @param options.colorIn=rgba(255,0,0,0.3){string} 扫描颜色
* @param options.colorOut=#ff0000 {string} 范围颜色
* @param options.colorIn=#ff0000 {string} 扫描颜色
* @param options.radius=10 {number} 半径
* @param options.duration=2000 {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} 视野缩放最远距离
* @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} 弹框确认时的回调
*/
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);
@ -1317,9 +1287,9 @@ class RadarScanStereoscopic extends Base {
else if (this.options.positions) {
position = { ...this.options.positions[0] }
}
// else if (this.options.center) {
// position = { ...this.options.center }
// }
else if (this.options.center) {
position = { ...this.options.center }
}
else if (this.options.start) {
position = { ...this.options.start }
}

View File

@ -19,56 +19,22 @@ 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 {number} 经度
* @param options.center.lat {number}
* @param options.center.alt {number} 高度
* @param options.center.lng {object} 经度
* @param options.center.lat {object}
* @param options.radius=10 {number} 半径
* @param options.startAngle=10 {number} 起始方向
* @param options.endAngle=0 {number} 结束方向
* @param options.line {object} 边框
* @param options.line.width=3 {number} 边框宽
* @param options.line.width=3 {string} 边框宽
* @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);
@ -1889,7 +1855,6 @@ class SectorObject extends Base {
that.positionEditing = false
if (YJ.Measure.GetMeasureStatus()) {
} else {
let entity
that.event && that.event.destroy()
that.event = new MouseEvent(that.sdk)
YJ.Measure.SetMeasureStatus(true)
@ -1900,9 +1865,7 @@ class SectorObject extends Base {
let fromDegreesArray = that.calSector(that.options.center, that.options.radius, that.options.startAngle, that.options.endAngle)
let points = []
let endpoint = { ...that.options.center }
let radius = that.options.radius
let moveRadius = null
let options = {
angle1: that.options.startAngle,
angle2: that.options.endAngle
@ -2005,14 +1968,12 @@ class SectorObject extends Base {
that.sdk.viewer.entities.remove(that.nodePoints[i])
}
that.nodePoints = []
createRadiusLine()
}
}
})
that.event.mouse_move((movement, cartesian) => {
if (selectPoint) {
entity && (entity.show = true)
let pos84 = that.cartesian3Towgs84(cartesian, that.sdk.viewer)
if (selectPoint._type === 'sector-start') {
points[1] = pos84
@ -2021,8 +1982,9 @@ class SectorObject extends Base {
points[2] = pos84
}
options = calculateAangle(points)
radius = that.computeDistance2([points[0], pos84]);
endpoint = that.cartesian3Towgs84(cartesian, that.viewer)
let pointA = Cesium.Cartesian3.fromDegrees(points[0].lng, points[0].lat, 0);
let pointB = Cesium.Cartesian3.fromDegrees(pos84.lng, pos84.lat, 0);;
radius = Cesium.Cartesian3.distance(pointA, pointB);
fromDegreesArray = that.calSector(that.options.center, radius, options.angle1, options.angle2)
}
@ -2063,38 +2025,6 @@ class SectorObject extends Base {
that.nodePoints.push(entity)
}
function createRadiusLine() {
entity = that.sdk.viewer.entities.add(
new Cesium.Entity({
show: false,
position: new Cesium.CallbackProperty((e) => {
if (endpoint) {
let c = that.computeMidpoint(that.options.center, endpoint)
return Cesium.Cartesian3.fromDegrees(c.lng, c.lat, endpoint.alt)
} else {
return Cesium.Cartesian3()
}
}, false),
label: {
text: new Cesium.CallbackProperty((e) => {
if (radius > 1000) {
return '半径:' + (radius / 1000).toFixed(2) + ' 公里'
}
return '半径:' + radius + ' 米'
}, false),
font: '20px Microsoft YaHei',
disableDepthTestDistance: Number.POSITIVE_INFINITY,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
fillColor: Cesium.Color.fromCssColorString('#f5ce0a'),
style: Cesium.LabelStyle.FILL_AND_OUTLINE
}
})
)
that.nodePoints.push(entity)
}
}
}

View File

@ -22,56 +22,14 @@ 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='rgba(255, 0, 0, 0.5)' {string} 颜色
* @param options.color="#ff000080" {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 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} 高度
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);
@ -2117,9 +2075,7 @@ class StraightArrowObject extends Base {
that.event.gesture_pinck_start(() => { })
if (selectPoint) {
if (!originalPosition) {
if (that.options.positions.length > 2) {
that.options.positions.pop()
}
that.options.positions.pop()
}
else {
that.options.positions[selectPoint.index] = originalPosition

View File

@ -134,15 +134,17 @@ class TextBox extends Base {
}
async getwords(words) {
this.options.text = words
this.callback(this.options)
let { sdkP } = getSdk()
if (this.sdk === sdkP && sdkP) {//三维
this.callback(this.options)
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) {
this.callback(this.options)
syncData(this.sdk, this.options.id)
}
}

View File

@ -14,27 +14,14 @@ 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 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} 高度
* @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} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options)

View File

@ -16,23 +16,12 @@ 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 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} 高度
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);
@ -550,7 +539,6 @@ class StandText extends Base {
let originalPosition
let positions = that.options.positions
let previous = [...that.options.positions]
let fromDegreesArray = []
let minimumHeights = []
let maximumHeights = []
@ -626,15 +614,6 @@ class StandText extends Base {
if(isAdd) {
that.options.positions.splice(selectPoint.index, 1)
}
if (!that.options.positions || that.options.positions.length < 2) {
console.warn('最少需要两个坐标!')
window.ELEMENT && window.ELEMENT.Message({
message: '最少需要两个坐标!',
type: 'warning',
duration: 1500
});
that.options.positions = [...previous]
}
cb(null, that.options.positions)
}
let positions = that.options.positions

View File

@ -7,7 +7,6 @@ import EditGltf from "../../ModelController/EditGltf";
import Controller from "../../../Controller/index";
import MouseTip from '../../../MouseTip'
import LabelObject from '../LabelObject'
import LabelObject2 from '../LabelObject2'
import { setActiveViewer, CameraController, closeRotateAround } from '../../../Global/global'
import { syncData, get2DView, get3DView } from '../../../Global/MultiViewportMode'
import { legp } from '../../../Obj/Element/datalist';
@ -24,9 +23,7 @@ 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} 运动延迟时间(毫秒)
@ -36,41 +33,22 @@ 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 {string} 模型地址
* @param options.model.url {url} 模型地址
* @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 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} 视野缩放最远距离
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);
@ -265,9 +243,9 @@ class TrajectoryMotion extends Base {
}
}
if (this.model && this.model.position) {
let heading = this.options.model.heading
let pitch = this.options.model.pitch
let roll = this.options.model.roll
let heading = this.model.heading
let pitch = this.model.pitch
let roll = this.model.roll
if (isNaN(heading) || isNaN(pitch) || isNaN(roll)) {
return
}
@ -1527,7 +1505,7 @@ class TrajectoryMotion extends Base {
static async createFuelLabel(that) {
let labelPosition = that.cartesian3Towgs84(that.model.position, that.sdk.viewer)
that.fuelLabel = new LabelObject2(that.sdk, {
that.fuelLabel = new LabelObject(that.sdk, {
show: that.options.show ? (that.options.fuelShow ? true : false) : false,
// show: true,
position: [labelPosition.lng, labelPosition.lat, labelPosition.alt],

View File

@ -1332,7 +1332,7 @@ class Vector extends Base {
return trsElm
}
async flyTo(id, options = {}) {
flyTo(id, options = {}) {
setActiveViewer(0)
closeRotateAround(this.sdk)
closeViewFollow(this.sdk)
@ -1392,34 +1392,33 @@ class Vector extends Base {
}
}
} else {
if (this.range) {
if (
this.options.customView &&
this.options.customView.relativePosition &&
this.options.customView.orientation
) {
let orientation = {
heading: Cesium.Math.toRadians(
this.options.customView.orientation.heading || 0.0
),
pitch: Cesium.Math.toRadians(
this.options.customView.orientation.pitch || -60.0
),
roll: Cesium.Math.toRadians(
this.options.customView.orientation.roll || 0.0
)
}
let position = { lng: this.range[0], lat: this.range[1] }
position.alt = await this.getClampToHeight(position)
let lng = this.options.customView.relativePosition.lng + position.lng
let lat = this.options.customView.relativePosition.lat + position.lat
let alt = this.options.customView.relativePosition.alt + position.alt
let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt)
this.sdk.viewer.camera.flyTo({
destination: destination,
orientation: orientation
})
} else {
if (
this.options.customView &&
this.options.customView.relativePosition &&
this.options.customView.orientation
) {
let orientation = {
heading: Cesium.Math.toRadians(
this.options.customView.orientation.heading || 0.0
),
pitch: Cesium.Math.toRadians(
this.options.customView.orientation.pitch || -60.0
),
roll: Cesium.Math.toRadians(
this.options.customView.orientation.roll || 0.0
)
}
let lng = this.options.customView.relativePosition.lng
let lat = this.options.customView.relativePosition.lat
let alt = this.options.customView.relativePosition.alt
let destination = Cesium.Cartesian3.fromDegrees(lng, lat, alt)
this.sdk.viewer.camera.flyTo({
destination: destination,
orientation: orientation
})
} else {
if (this.range) {
let array = []
this.getClampToHeight({
lng: this.range[0],

View File

@ -29,47 +29,13 @@ class WallRealStereoscopic extends Base {
* @param options.color="#ffffff" {string} 颜色
* @param options.width=0.24 {number} 宽
* @param options.show=true {boolean} 显隐
* @param options.noseToTail=false {boolean} 首尾相连
* @param options['nose-to-tail']=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>} 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 {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);
@ -1123,25 +1089,23 @@ class WallRealStereoscopic extends Base {
let positions = []
for (let i = 0; i < optionsPositions.length - 1; i++) {
if (optionsPositions[i]) {
let pot1 = turf.point([optionsPositions[i].lng, optionsPositions[i].lat])
let pot2 = turf.point([optionsPositions[i + 1].lng, optionsPositions[i + 1].lat])
let bearing = turf.rhumbBearing(pot1, pot2);
let destination = turf.destination(pot1, this.options.width / 2 / 1000, bearing + 90, { units: 'kilometers' });
let destination2 = turf.destination(pot2, this.options.width / 2 / 1000, bearing + 90, { units: 'kilometers' });
let destination3 = turf.destination(pot1, this.options.width / 2 / 1000, bearing - 90, { units: 'kilometers' });
let destination4 = turf.destination(pot2, this.options.width / 2 / 1000, bearing - 90, { units: 'kilometers' });
let coordinates = destination.geometry.coordinates
let coordinates2 = destination2.geometry.coordinates
let coordinates3 = destination3.geometry.coordinates
let coordinates4 = destination4.geometry.coordinates
coordinates[2] = optionsPositions[i].alt
coordinates2[2] = optionsPositions[i + 1].alt
coordinates3[2] = optionsPositions[i].alt
coordinates4[2] = optionsPositions[i + 1].alt
let pot1 = turf.point([optionsPositions[i].lng, optionsPositions[i].lat])
let pot2 = turf.point([optionsPositions[i + 1].lng, optionsPositions[i + 1].lat])
let bearing = turf.rhumbBearing(pot1, pot2);
let destination = turf.destination(pot1, this.options.width / 2 / 1000, bearing + 90, { units: 'kilometers' });
let destination2 = turf.destination(pot2, this.options.width / 2 / 1000, bearing + 90, { units: 'kilometers' });
let destination3 = turf.destination(pot1, this.options.width / 2 / 1000, bearing - 90, { units: 'kilometers' });
let destination4 = turf.destination(pot2, this.options.width / 2 / 1000, bearing - 90, { units: 'kilometers' });
let coordinates = destination.geometry.coordinates
let coordinates2 = destination2.geometry.coordinates
let coordinates3 = destination3.geometry.coordinates
let coordinates4 = destination4.geometry.coordinates
coordinates[2] = optionsPositions[i].alt
coordinates2[2] = optionsPositions[i + 1].alt
coordinates3[2] = optionsPositions[i].alt
coordinates4[2] = optionsPositions[i + 1].alt
pos1.push([coordinates, coordinates2, coordinates4, coordinates3, coordinates])
}
pos1.push([coordinates, coordinates2, coordinates4, coordinates3, coordinates])
}
positions.push(pos1[0])
@ -1696,7 +1660,7 @@ class WallRealStereoscopic extends Base {
_addRr() {
if (this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value) {
this.options.attribute.vr.content.push({
name: '全景图',
name: '全景图' ,
url: this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value
})
this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value = ''
@ -1709,7 +1673,7 @@ class WallRealStereoscopic extends Base {
addAttributeRr(vr) {
this.options.attribute.vr.content.push({
name: '全景图',
name: '全景图' ,
url: vr
})
this.attributeVr = this.options.attribute.vr.content
@ -1832,7 +1796,6 @@ class WallRealStereoscopic extends Base {
let wallPositions = []
let topPositions = []
let previous = [...that.options.positions]
let isAdd = false
let firstMove = true
let leftEvent = (movement, cartesian) => {
@ -1886,15 +1849,6 @@ class WallRealStereoscopic extends Base {
if (isAdd) {
that.options.positions.splice(selectPoint.index, 1)
}
if (!that.options.positions || that.options.positions.length < 2) {
console.warn('最少需要两个坐标!')
window.ELEMENT && window.ELEMENT.Message({
message: '最少需要两个坐标!',
type: 'warning',
duration: 1500
});
that.options.positions = [...previous]
}
update()
cb(null, that.options.positions)
}
@ -1922,44 +1876,42 @@ class WallRealStereoscopic extends Base {
wallPositions = []
topPositions = []
for (let i = 0; i < positions.length; i++) {
if (positions[i]) {
let fromDegreesArray = []
let fromDegreesArray2 = []
for (let n = 0; n < positions[i].length; n++) {
fromDegreesArray.push(positions[i][n][0], positions[i][n][1], positions[i][n][2])
fromDegreesArray2.push(positions[i][n][0], positions[i][n][1], positions[i][n][2] + that.options.extrudedHeight)
}
wallPositions.push(fromDegreesArray)
topPositions.push(fromDegreesArray2)
let wall = that.sdk.viewer.entities.add({
id: that.options.id + '-' + WallRealStereoscopic.randomString(12),
polylineVolume: {
positions: isCallback ? new Cesium.CallbackProperty(function () {
return Cesium.Cartesian3.fromDegreesArrayHeights(wallPositions[i])
}, false) : Cesium.Cartesian3.fromDegreesArrayHeights(wallPositions[i]),
shape: [
{ x: -0.0000001, y: -that.options.extrudedHeight / 2 },
{ x: 0.0000001, y: -that.options.extrudedHeight / 2 },
{ x: 0.0000001, y: that.options.extrudedHeight / 2 },
{ x: -0.0000001, y: that.options.extrudedHeight / 2 },
],
cornerType: Cesium.CornerType.MITERED
},
})
let top = that.sdk.viewer.entities.add({
id: that.options.id + '-' + WallRealStereoscopic.randomString(12),
polygon: {
hierarchy: isCallback ? new Cesium.CallbackProperty(function () {
return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(topPositions[i]))
}, false) : new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(topPositions[i])),
perPositionHeight: true,
material: Cesium.Color.fromCssColorString(that.options.color)
},
})
that.entity.add(wall)
that.entity.add(top)
wall.polylineVolume.material = that.getMaterial(wall.id)
let fromDegreesArray = []
let fromDegreesArray2 = []
for (let n = 0; n < positions[i].length; n++) {
fromDegreesArray.push(positions[i][n][0], positions[i][n][1], positions[i][n][2])
fromDegreesArray2.push(positions[i][n][0], positions[i][n][1], positions[i][n][2] + that.options.extrudedHeight)
}
wallPositions.push(fromDegreesArray)
topPositions.push(fromDegreesArray2)
let wall = that.sdk.viewer.entities.add({
id: that.options.id + '-' + WallRealStereoscopic.randomString(12),
polylineVolume: {
positions: isCallback ? new Cesium.CallbackProperty(function () {
return Cesium.Cartesian3.fromDegreesArrayHeights(wallPositions[i])
}, false) : Cesium.Cartesian3.fromDegreesArrayHeights(wallPositions[i]),
shape: [
{ x: -0.0000001, y: -that.options.extrudedHeight / 2 },
{ x: 0.0000001, y: -that.options.extrudedHeight / 2 },
{ x: 0.0000001, y: that.options.extrudedHeight / 2 },
{ x: -0.0000001, y: that.options.extrudedHeight / 2 },
],
cornerType: Cesium.CornerType.MITERED
},
})
let top = that.sdk.viewer.entities.add({
id: that.options.id + '-' + WallRealStereoscopic.randomString(12),
polygon: {
hierarchy: isCallback ? new Cesium.CallbackProperty(function () {
return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(topPositions[i]))
}, false) : new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(topPositions[i])),
perPositionHeight: true,
material: Cesium.Color.fromCssColorString(that.options.color)
},
})
that.entity.add(wall)
that.entity.add(top)
wall.polylineVolume.material = that.getMaterial(wall.id)
}
}
}
@ -1973,19 +1925,18 @@ class WallRealStereoscopic extends Base {
if (selectPoint) {
let pos3 = that.sdk.viewer.scene.clampToHeight(cartesian, [...that.entity.values])
that.options.positions[selectPoint.index] = that.cartesian3Towgs84(pos3, that.sdk.viewer)
if (that.options.positions && that.options.positions.length >= 2) {
let positions = that.calculatePositions()
for (let i = 0; i < positions.length; i++) {
let fromDegreesArray = []
let fromDegreesArray2 = []
for (let n = 0; n < positions[i].length; n++) {
fromDegreesArray.push(positions[i][n][0], positions[i][n][1], positions[i][n][2])
fromDegreesArray2.push(positions[i][n][0], positions[i][n][1], positions[i][n][2] + that.options.extrudedHeight)
}
wallPositions[i] = fromDegreesArray
topPositions[i] = fromDegreesArray2
let positions = that.calculatePositions()
for (let i = 0; i < positions.length; i++) {
let fromDegreesArray = []
let fromDegreesArray2 = []
for (let n = 0; n < positions[i].length; n++) {
fromDegreesArray.push(positions[i][n][0], positions[i][n][1], positions[i][n][2])
fromDegreesArray2.push(positions[i][n][0], positions[i][n][1], positions[i][n][2] + that.options.extrudedHeight)
}
wallPositions[i] = fromDegreesArray
topPositions[i] = fromDegreesArray2
}
that.label.position = [that.options.positions[0].lng, that.options.positions[0].lat, that.options.positions[0].alt + that.options.extrudedHeight]
// if (firstMove) {
// firstMove = false
@ -2067,40 +2018,38 @@ class WallRealStereoscopic extends Base {
this.entity.removeAll()
for (let i = 0; i < positions.length; i++) {
if (positions[0]) {
let fromDegreesArray = []
let fromDegreesArray2 = []
for (let n = 0; n < positions[i].length; n++) {
fromDegreesArray.push(positions[i][n][0], positions[i][n][1], positions[i][n][2])
fromDegreesArray2.push(positions[i][n][0], positions[i][n][1], positions[i][n][2] + this.options.extrudedHeight)
}
wallPositions.push(fromDegreesArray)
topPositions.push(fromDegreesArray2)
let wall = this.sdk.viewer.entities.add({
id: this.options.id + '-' + WallRealStereoscopic.randomString(12),
polylineVolume: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights(wallPositions[i]),
shape: [
{ x: -0.0000001, y: -this.options.extrudedHeight / 2 },
{ x: 0.0000001, y: -this.options.extrudedHeight / 2 },
{ x: 0.0000001, y: this.options.extrudedHeight / 2 },
{ x: -0.0000001, y: this.options.extrudedHeight / 2 },
],
cornerType: Cesium.CornerType.MITERED
},
})
let top = this.sdk.viewer.entities.add({
id: this.options.id + '-' + WallRealStereoscopic.randomString(12),
polygon: {
hierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(topPositions[i])),
perPositionHeight: true,
material: Cesium.Color.fromCssColorString(this.options.color)
},
})
this.entity.add(wall)
this.entity.add(top)
wall.polylineVolume.material = this.getMaterial(wall.id)
let fromDegreesArray = []
let fromDegreesArray2 = []
for (let n = 0; n < positions[i].length; n++) {
fromDegreesArray.push(positions[i][n][0], positions[i][n][1], positions[i][n][2])
fromDegreesArray2.push(positions[i][n][0], positions[i][n][1], positions[i][n][2] + this.options.extrudedHeight)
}
wallPositions.push(fromDegreesArray)
topPositions.push(fromDegreesArray2)
let wall = this.sdk.viewer.entities.add({
id: this.options.id + '-' + WallRealStereoscopic.randomString(12),
polylineVolume: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights(wallPositions[i]),
shape: [
{ x: -0.0000001, y: -this.options.extrudedHeight / 2 },
{ x: 0.0000001, y: -this.options.extrudedHeight / 2 },
{ x: 0.0000001, y: this.options.extrudedHeight / 2 },
{ x: -0.0000001, y: this.options.extrudedHeight / 2 },
],
cornerType: Cesium.CornerType.MITERED
},
})
let top = this.sdk.viewer.entities.add({
id: this.options.id + '-' + WallRealStereoscopic.randomString(12),
polygon: {
hierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(topPositions[i])),
perPositionHeight: true,
material: Cesium.Color.fromCssColorString(this.options.color)
},
})
this.entity.add(wall)
this.entity.add(top)
wall.polylineVolume.material = this.getMaterial(wall.id)
}
}
}

View File

@ -23,46 +23,12 @@ class WallStereoscopic extends Base {
* @param options.color="#00d9ff" {string} 颜色
* @param options.show=true {boolean} 显隐
* @param options.extrudedHeight=2.4 {number} 拉伸高度
* @param options.noseToTail=false {boolean} 首尾相连
* @param options['nose-to-tail']=false {boolean} 首尾相连
* @param options.material=0 {number} 材质0纯色墙1上升墙2箭头墙3警戒墙
* @param options.duration=1000 {number} 持续时间
* @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 {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
* @param _Dialog {object} 弹框事件
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);
@ -1317,7 +1283,6 @@ class WallStereoscopic extends Base {
let originalPosition
let positions = that.options.positions
let previous = [...that.options.positions]
let fromDegreesArray = []
for (let i = 0; i < positions.length; i++) {
fromDegreesArray.push(positions[i].lng, positions[i].lat, positions[i].alt)
@ -1383,15 +1348,6 @@ class WallStereoscopic extends Base {
if (isAdd) {
that.options.positions.splice(selectPoint.index, 1)
}
if (!that.options.positions || that.options.positions.length < 2) {
console.warn('最少需要两个坐标!')
window.ELEMENT && window.ELEMENT.Message({
message: '最少需要两个坐标!',
type: 'warning',
duration: 1500
});
that.options.positions = [...previous]
}
cb(null, that.options.positions)
}
let positions = that.options.positions

View File

@ -15,17 +15,14 @@ class WaterSurface extends Base {
* @param sdk
* @description 水面
* @param options {object} 面属性
* @param options.id {string} 唯一标识
* @param options.show=true {boolean} 显隐
* @param options.name=未命名对象 {string} 名称
* @param {Array.<object>} options.positions 坐标列表
* @param options.positions[].lng {number} 经度
* @param options.positions[].lat {number} 纬度
* @param options.positions[].alt {number} 高度
* @param options.positions {Array.<{lng:number, lat:number, alt:number}>} 坐标数组
* @param options.color=rgba(32,67,135,0.5) {string} 颜色
* @param options.frequency=10 {number} 频率
* @param options.animationSpeed=1 {number} 动画速度
* @param options.frequency=100 {number} 频率
* @param options.animationSpeed=0.02 {number} 动画速度
* @param options.amplitude=10 {number} 振幅
* @param Dialog {object} 弹框对象
* @param Dialog.confirmCallBack {function} 弹框确认时的回调
* */
constructor(sdk, options = {}, _Dialog = {}) {
super(sdk, options);

View File

@ -62,16 +62,10 @@
for (let i = 0; i < contentElm.length; i++) {
if (i === parseInt(tabindex)) {
contentElm[i].style.display = ''
setTimeout(() => {
contentElm[i].style.width = '100%'
contentElm[i].style.overflow = 'unset'
}, 0);
tabs[i].className = 'DIV-cy-tab-pane-title-p is-active'
}
else {
contentElm[i].style.display = 'none'
contentElm[i].style.width = 0
contentElm[i].style.overflow = 'auto'
tabs[i].className = 'DIV-cy-tab-pane-title-p'
}
}

View File

@ -917,32 +917,6 @@ function attributeElm(that) {
</div>
</div>
</div>
<div class="row attribute-content attribute-content-rtmp">
<div class="col">
<span class="label">添加链接</span>
<div style="flex: 1;position: relative;">
<input class="input rtmp_add" type="text">
<i class="rtmp_add_btn" @click="_addRtmp"></i>
</div>
</div>
</div>
<div class="attribute-content attribute-content-rtmp">
<div class="table">
<div class="table-head">
<div class="tr">
<div class="th">名称</div>
<div class="th">链接</div>
<div class="th">操作</div>
</div>
</div>
<div class="table-body">
</div>
<div class="table-empty">
<div class="empty-img"></div>
<p>暂无数据</p>
</div>
</div>
</div>
<div class="attribute-content attribute-content-goods">
<div>
<div class="row">

View File

@ -94,8 +94,6 @@ function RadarScan() {
float falloff = length(scrPtRot);
material.alpha = pow(length(col + vec3(.5)),5.0) * transparency * 0.6;
material.diffuse = (0.5 + pow(angle, 2.0) * falloff ) * color.rgb ;
// float pattern = 0.5 + pow(angle, 2.0) * falloff; // 旋转的明暗图案
// material.diffuse = color.rgb * pattern + (1.0 - pattern) * 0.2; // 保留基础色,叠加明暗
return material;
}

View File

@ -1021,26 +1021,18 @@ class Proj {
function tenToThePowerOfN(n) {
return Math.pow(10, n);
}
let isF = false
if(degrees<0) {
isF = true
}
degrees = Math.abs(degrees)
let d = Math.floor(degrees); // 获取整度
let pow1 = tenToThePowerOfN(getDecimalPlaces(degrees))
let x = Math.floor((degrees - d) * pow1 * 60) / pow1; // 获取秒3600分之一度
let m = Math.floor(x);
if(isF) {
d = -d
}
let pow = tenToThePowerOfN(getDecimalPlaces(x))
let s = Math.floor((x - m) * pow) / pow * 60; // 获取秒3600分之一度
if (isDM) {
return d + "°" + (Math.floor(x * 10000) / 10000) + "'"; // 返回度分格式
return d + "°" + Number(x.toFixed(4)) + "'"; // 返回度分格式
}
else {
return d + "°" + m + "'" + (Math.floor(s * 100) / 100) + '"'; // 返回度分秒格式
return d + "°" + m + "'" + s.toFixed(2) + '"'; // 返回度分秒格式
}
}

View File

@ -443,12 +443,16 @@ class YJEarth {
_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)
// let { sdkP } = getSdk()
// if (_this == sdkP && sdkP) {//二维
// _this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
// } else if (!sdkP) {
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
// }
_this.clickTextDom.querySelector('textarea').removeEventListener('blur', _this.blurFun)
}
_this.clickTextDom.querySelector('textarea').addEventListener('blur', _this.blurFun)
_this.clickTextDom.querySelector('textarea').removeEventListener('blur', _this.blurFun)
break;
}
}
@ -503,7 +507,7 @@ class YJEarth {
_this.clickTextDom.removeEventListener('mousedown', mousedown);
_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.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
_this.clickTextDom.style['pointer-events'] = 'none'
_this.clickTextDom = undefined

View File

@ -828,83 +828,39 @@
this.uid = uid
_this.box.setAttribute("color-box-id", uid)
function clickEvent(event) {
console.log('------------')
if(!document.contains(_this.box)) {
document.removeEventListener('click', clickEvent);
}
// 检查点击事件是否发生在核心元素或其子元素之外
let boxNode
function recursion(node) {
if(!node.parentNode) {
boxNode = node
}
else {
if(node.getAttribute("color-box-id") === uid) {
boxNode = node
}
else {
recursion(node.parentNode)
}
}
}
recursion(event.target)
if(!boxNode) {
if(_this.pickerFlag) {
_this.close()
}
}
else {
if (!boxNode.getAttribute || boxNode.getAttribute("color-box-id") !== uid) {
if(_this.pickerFlag) {
_this.close()
}
}
}
}
let mousedownEln
let mouseupEln
let flag = false
function mousedownEvent(event) {
flag = false
if(!document.contains(_this.box)) {
document.removeEventListener('mousedown', mousedownEvent);
}
// 检查点击事件是否发生在核心元素或其子元素之外
let boxNode
function recursion(node) {
if(!node.parentNode) {
boxNode = node
}
else {
if(node.getAttribute("color-box-id") === uid) {
boxNode = node
}
else {
recursion(node.parentNode)
}
}
}
recursion(event.target)
if(!boxNode) {
if(_this.pickerFlag) {
flag = true
}
}
else {
if (!boxNode.getAttribute || boxNode.getAttribute("color-box-id") !== uid) {
if(_this.pickerFlag) {
flag = true
}
}
}
}
function mouseupEvent(event) {
if(!document.contains(_this.box)) {
document.removeEventListener('mouseup', mouseupEvent);
}
// 检查点击事件是否发生在核心元素或其子元素之外
let boxNode
function recursion(node) {
if(!node.parentNode) {
boxNode = node
}
else {
if(node.getAttribute("color-box-id") === uid) {
boxNode = node
}
else {
recursion(node.parentNode)
}
}
}
recursion(event.target)
if(!boxNode) {
if(_this.pickerFlag && flag) {
_this.close()
}
}
else {
if (!boxNode.getAttribute || boxNode.getAttribute("color-box-id") !== uid) {
if(_this.pickerFlag && flag) {
_this.close()
}
}
}
flag = false
}
// document.addEventListener('click', clickEvent);
document.addEventListener('mousedown', mousedownEvent);
document.addEventListener('mouseup', mouseupEvent);
document.addEventListener('click', clickEvent);
return this
}
function h(e) {

View File

@ -20096,8 +20096,8 @@
var testing =
'<div class="compass" title="拖动外圈:旋转视图,' +
'拖动内陀螺仪:自由轨道,' +
'双击:重置视图' +
'" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }">' +
'双击:重置视图' +
'提示您还可以按住CTRL键并拖动地图来释放轨道." data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }">' +
'<div class="compass-outer-ring-background"></div>' +
" <div class=\"compass-rotation-marker\" data-bind=\"visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }, cesiumSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }\"></div>" +
" <div class=\"compass-outer-ring\" title=\"单击并拖动以旋转相机\" data-bind=\"style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }, cesiumSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }\"></div>" +

View File

@ -426,8 +426,7 @@
}
.YJ-custom-base-dialog>.content .attribute .attribute-content-link .link_add_btn,
.YJ-custom-base-dialog>.content .attribute .attribute-content-vr .vr_add_btn,
.YJ-custom-base-dialog>.content .attribute .attribute-content-rtmp .rtmp_add_btn {
.YJ-custom-base-dialog>.content .attribute .attribute-content-vr .vr_add_btn {
display: inline-block;
width: 20px;
height: 20px;
@ -439,14 +438,12 @@
}
.YJ-custom-base-dialog>.content .attribute .attribute-content-link .link_add,
.YJ-custom-base-dialog>.content .attribute .attribute-content-vr .vr_add,
.YJ-custom-base-dialog>.content .attribute .attribute-content-rtmp .rtmp_add {
.YJ-custom-base-dialog>.content .attribute .attribute-content-vr .vr_add {
padding-right: 30px;
}
.YJ-custom-base-dialog>.content .attribute .attribute-content-link .tr .td:last-child button:first-child,
.YJ-custom-base-dialog>.content .attribute .attribute-content-vr .tr .td:last-child button:first-child,
.YJ-custom-base-dialog>.content .attribute .attribute-content-rtmp .tr .td:last-child button:first-child {
.YJ-custom-base-dialog>.content .attribute .attribute-content-vr .tr .td:last-child button:first-child {
margin-right: 5px;
}
@ -480,6 +477,9 @@
border-top: none;
}
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr,
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr {}
.YJ-custom-base-dialog>.content .table .table-empty {
display: flex;
align-items: center;
@ -535,8 +535,7 @@
}
.YJ-custom-base-dialog>.content .attribute-content-link .table .table-body,
.YJ-custom-base-dialog>.content .attribute-content-vr .table .table-body,
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .table-body {
.YJ-custom-base-dialog>.content .attribute-content-vr .table .table-body {
max-height: 172px;
}
@ -579,9 +578,7 @@
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(1),
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(1),
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(1),
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(1),
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .th:nth-child(1),
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td:nth-child(1) {
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(1) {
width: 164px;
flex: 0 0 164px;
}
@ -589,9 +586,7 @@
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(2),
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(2),
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(2),
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(2),
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .th:nth-child(2),
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td:nth-child(2) {
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(2) {
width: 226px;
flex: 0 0 226px;
}
@ -599,17 +594,14 @@
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(3),
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(3),
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(3),
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(3),
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(3) {
flex: 0 0 150px;
width: 150px;
justify-content: center;
}
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td .input-group .input,
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td .input-group .input,
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td .input-group .input {
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td .input-group .input {
border-radius: 5px 0 0 5px;
}