Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0_new
This commit is contained in:
@ -12,8 +12,8 @@ let repeat = 0
|
|||||||
let currentRepeat = 0
|
let currentRepeat = 0
|
||||||
|
|
||||||
|
|
||||||
const open = async (sdk, options = {}, _Dialog = {}) => {
|
const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
||||||
let name = options.name || '飞线漫游'
|
let name = options.name || '漫游路径'
|
||||||
options.points || (options.points = [])
|
options.points || (options.points = [])
|
||||||
if (options.repeat) {
|
if (options.repeat) {
|
||||||
repeat = Number(options.repeat)
|
repeat = Number(options.repeat)
|
||||||
@ -74,8 +74,9 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
|||||||
name = nameElm.value
|
name = nameElm.value
|
||||||
})
|
})
|
||||||
|
|
||||||
let addListBtn = document.createElement('button');
|
// let addListBtn = document.createElement('button');
|
||||||
addListBtn.innerHTML = '保存'
|
let addListBtn = document.getElementsByClassName('saveRoam')[0];
|
||||||
|
// addListBtn.innerHTML = '保存'
|
||||||
addListBtn.addEventListener('click', () => {
|
addListBtn.addEventListener('click', () => {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
name = '漫游路径'
|
name = '漫游路径'
|
||||||
@ -85,6 +86,12 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
|||||||
points.map((item) => {
|
points.map((item) => {
|
||||||
newPoints.push(item)
|
newPoints.push(item)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
func({
|
||||||
|
name: name,
|
||||||
|
points: newPoints,
|
||||||
|
repeat: repeat + ''
|
||||||
|
})
|
||||||
// _Dialog.clickSavePath && _Dialog.clickSavePath(
|
// _Dialog.clickSavePath && _Dialog.clickSavePath(
|
||||||
// {
|
// {
|
||||||
// name: name,
|
// name: name,
|
||||||
@ -124,20 +131,20 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
|||||||
addTrElm(data)
|
addTrElm(data)
|
||||||
i++
|
i++
|
||||||
})
|
})
|
||||||
let modifyBtn = contentElm.getElementsByClassName('modify-point')[0]
|
// let modifyBtn = contentElm.getElementsByClassName('modify-point')[0]
|
||||||
modifyBtn.addEventListener('click', () => {
|
// modifyBtn.addEventListener('click', () => {
|
||||||
if (!active) {
|
// if (!active) {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
// let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
||||||
points[active - 1].position = position
|
// points[active - 1].position = position
|
||||||
points[active - 1].orientation = {
|
// points[active - 1].orientation = {
|
||||||
heading: viewer.camera.heading,
|
// heading: viewer.camera.heading,
|
||||||
pitch: viewer.camera.pitch,
|
// pitch: viewer.camera.pitch,
|
||||||
roll: viewer.camera.roll
|
// roll: viewer.camera.roll
|
||||||
}
|
// }
|
||||||
tools.message({ text: '操作成功' })
|
// tools.message({ text: '操作成功' })
|
||||||
})
|
// })
|
||||||
|
|
||||||
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
||||||
let isTotalTimeElm = contentElm.querySelector("input[name='isTotalTime']")
|
let isTotalTimeElm = contentElm.querySelector("input[name='isTotalTime']")
|
||||||
@ -287,11 +294,13 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
|||||||
// }
|
// }
|
||||||
})
|
})
|
||||||
e_time.addEventListener('input', (v) => {
|
e_time.addEventListener('input', (v) => {
|
||||||
|
console.log(isTotalTimeElm, 'isTotalTimeElm')
|
||||||
isTotalTimeElm.checked = false
|
isTotalTimeElm.checked = false
|
||||||
data.duration = Number(e_time.value)
|
data.duration = Number(e_time.value)
|
||||||
if (data.duration < 0) {
|
if (data.duration < 0) {
|
||||||
data.duration = 0
|
data.duration = 0
|
||||||
}
|
}
|
||||||
|
console.log(data.duration, 'duration')
|
||||||
})
|
})
|
||||||
e_time.addEventListener('blur', () => {
|
e_time.addEventListener('blur', () => {
|
||||||
e_time.value = Number(Number(e_time.value).toFixed(2))
|
e_time.value = Number(Number(e_time.value).toFixed(2))
|
||||||
@ -325,6 +334,7 @@ const close = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const executeFlyTo = (sdk, points = [], index = 0, noStart) => {
|
const executeFlyTo = (sdk, points = [], index = 0, noStart) => {
|
||||||
|
console.log(noStart, points, 'noStart')
|
||||||
if (clickHandler) {
|
if (clickHandler) {
|
||||||
clickHandler.destroy()
|
clickHandler.destroy()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,11 +241,12 @@ async function ScreenShotHD(sdk, options = {}, cd = () => { }) {
|
|||||||
start() {
|
start() {
|
||||||
if (sdk.viewer.scene.imageryLayers._layers.length <= 1) {
|
if (sdk.viewer.scene.imageryLayers._layers.length <= 1) {
|
||||||
this.error = '未加载底图!'
|
this.error = '未加载底图!'
|
||||||
window.ELEMENT && window.ELEMENT.Message({
|
// window.ELEMENT && window.ELEMENT.Message({
|
||||||
message: this.error,
|
// message: this.error,
|
||||||
type: 'warning',
|
// type: 'warning',
|
||||||
duration: 1500
|
// duration: 1500
|
||||||
});
|
// });
|
||||||
|
tools.message({ type: 'warning', text: this.error })
|
||||||
console.warn(this.error)
|
console.warn(this.error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -258,11 +259,12 @@ async function ScreenShotHD(sdk, options = {}, cd = () => { }) {
|
|||||||
}
|
}
|
||||||
if (!haveBaseMap) {
|
if (!haveBaseMap) {
|
||||||
this.error = '未加载底图!'
|
this.error = '未加载底图!'
|
||||||
window.ELEMENT && window.ELEMENT.Message({
|
// window.ELEMENT && window.ELEMENT.Message({
|
||||||
message: this.error,
|
// message: this.error,
|
||||||
type: 'warning',
|
// type: 'warning',
|
||||||
duration: 1500
|
// duration: 1500
|
||||||
});
|
// });
|
||||||
|
tools.message({ type: 'warning', text: this.error })
|
||||||
console.warn(this.error)
|
console.warn(this.error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -327,11 +329,12 @@ async function ScreenShotHD(sdk, options = {}, cd = () => { }) {
|
|||||||
if (!layer) {
|
if (!layer) {
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
_this.error = '当前范围内未找到底图数据!'
|
_this.error = '当前范围内未找到底图数据!'
|
||||||
window.ELEMENT && window.ELEMENT.Message({
|
// window.ELEMENT && window.ELEMENT.Message({
|
||||||
message: _this.error,
|
// message: _this.error,
|
||||||
type: 'warning',
|
// type: 'warning',
|
||||||
duration: 1500
|
// duration: 1500
|
||||||
});
|
// });
|
||||||
|
tools.message({ type: 'warning', text: _this.error })
|
||||||
console.warn(_this.error)
|
console.warn(_this.error)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -372,11 +375,12 @@ async function ScreenShotHD(sdk, options = {}, cd = () => { }) {
|
|||||||
);
|
);
|
||||||
if (!MinTile || !MaxTile) {
|
if (!MinTile || !MaxTile) {
|
||||||
let error = '超出地球范围!'
|
let error = '超出地球范围!'
|
||||||
window.ELEMENT && window.ELEMENT.Message({
|
// window.ELEMENT && window.ELEMENT.Message({
|
||||||
message: error,
|
// message: error,
|
||||||
type: 'warning',
|
// type: 'warning',
|
||||||
duration: 1500
|
// duration: 1500
|
||||||
});
|
// });
|
||||||
|
tools.message({ type: 'warning', text: error })
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ class Section extends Tools {
|
|||||||
this.options.regionsType = this.options.regionsType || false
|
this.options.regionsType = this.options.regionsType || false
|
||||||
YJ.Analysis.SectionResults.push(this)
|
YJ.Analysis.SectionResults.push(this)
|
||||||
this.Planes = []
|
this.Planes = []
|
||||||
|
this.tools = new Tools();
|
||||||
Section.start(this)
|
Section.start(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,12 +34,13 @@ class Section extends Tools {
|
|||||||
|
|
||||||
static start(that) {
|
static start(that) {
|
||||||
let positions = that.options.positions || []
|
let positions = that.options.positions || []
|
||||||
if(!that.isConvex(positions)) {
|
if (!that.isConvex(positions)) {
|
||||||
window.ELEMENT && window.ELEMENT.Message({
|
// window.ELEMENT && window.ELEMENT.Message({
|
||||||
message: '不支持凹多边形',
|
// message: '不支持凹多边形',
|
||||||
type: 'warning',
|
// type: 'warning',
|
||||||
duration: 1500
|
// duration: 1500
|
||||||
});
|
// });
|
||||||
|
that.tools.message({ type: 'warning', text: '不支持凹多边形' })
|
||||||
console.log('不支持凹多边形')
|
console.log('不支持凹多边形')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -87,9 +89,9 @@ class Section extends Tools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(that.tiles3d.clippingPlanes) {
|
if (that.tiles3d.clippingPlanes) {
|
||||||
that.tiles3d.clippingPlanes.removeAll()
|
that.tiles3d.clippingPlanes.removeAll()
|
||||||
for(let i=0;i<that.Planes.length;i++) {
|
for (let i = 0; i < that.Planes.length; i++) {
|
||||||
that.tiles3d.clippingPlanes.add(that.Planes[i])
|
that.tiles3d.clippingPlanes.add(that.Planes[i])
|
||||||
}
|
}
|
||||||
that.tiles3d.clippingPlanes.enabled = true
|
that.tiles3d.clippingPlanes.enabled = true
|
||||||
@ -135,7 +137,7 @@ class Section extends Tools {
|
|||||||
destroy() {
|
destroy() {
|
||||||
this.Planes = []
|
this.Planes = []
|
||||||
// this.tiles3d.clippingPlanes = new Cesium.ClippingPlaneCollection()
|
// this.tiles3d.clippingPlanes = new Cesium.ClippingPlaneCollection()
|
||||||
if(this.tiles3d.clippingPlanes) {
|
if (this.tiles3d.clippingPlanes) {
|
||||||
this.tiles3d.clippingPlanes.enabled = false
|
this.tiles3d.clippingPlanes.enabled = false
|
||||||
this.tiles3d.clippingPlanes.removeAll()
|
this.tiles3d.clippingPlanes.removeAll()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,7 +158,8 @@ class TerrainExcavation extends Tools {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.isConvex(positions)) {
|
if (!this.isConvex(positions)) {
|
||||||
this.tools.message({ type: 'warning', text: '至少拥有三个坐标位置!' })
|
// this.tools.message({ type: 'warning', text: '至少拥有三个坐标位置!' })
|
||||||
|
this.tools.message({ type: 'warning', text: '不支持凹多边形' })
|
||||||
console.log('不支持凹多边形')
|
console.log('不支持凹多边形')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import { setSplitDirection, syncSplitData, setActiveId, getSdk } from '../../../
|
|||||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../../Global/global'
|
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../../../Global/global'
|
||||||
|
|
||||||
class Model extends BaseModel {
|
class Model extends BaseModel {
|
||||||
#timeoutEventObject = null
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @description 加载模型
|
* @description 加载模型
|
||||||
@ -88,7 +87,8 @@ class Model extends BaseModel {
|
|||||||
console.warn("lat is required!")
|
console.warn("lat is required!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(this.options.earth) {
|
this._timeoutEventObject = null
|
||||||
|
if (this.options.earth) {
|
||||||
delete this.options.earth
|
delete this.options.earth
|
||||||
}
|
}
|
||||||
this.picking = true
|
this.picking = true
|
||||||
@ -266,8 +266,8 @@ class Model extends BaseModel {
|
|||||||
}, this.entity)
|
}, this.entity)
|
||||||
}
|
}
|
||||||
this.entity.isMove = true
|
this.entity.isMove = true
|
||||||
clearTimeout(this.#timeoutEventObject)
|
clearTimeout(this._timeoutEventObject)
|
||||||
this.#timeoutEventObject = setTimeout(() => {
|
this._timeoutEventObject = setTimeout(() => {
|
||||||
this.entity && (this.entity.isMove = false)
|
this.entity && (this.entity.isMove = false)
|
||||||
}, 500);
|
}, 500);
|
||||||
})
|
})
|
||||||
@ -304,8 +304,8 @@ class Model extends BaseModel {
|
|||||||
}, this.entity)
|
}, this.entity)
|
||||||
}
|
}
|
||||||
this.entity.isMove = true
|
this.entity.isMove = true
|
||||||
clearTimeout(this.#timeoutEventObject)
|
clearTimeout(this._timeoutEventObject)
|
||||||
this.#timeoutEventObject = setTimeout(() => {
|
this._timeoutEventObject = setTimeout(() => {
|
||||||
this.entity && (this.entity.isMove = false)
|
this.entity && (this.entity.isMove = false)
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
@ -462,6 +462,16 @@ class Model extends BaseModel {
|
|||||||
this.options.url = this.options.url || ""
|
this.options.url = this.options.url || ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get name() {
|
||||||
|
return this.options.name
|
||||||
|
}
|
||||||
|
set name(v) {
|
||||||
|
console.log(v, 'vvvvvvvvv')
|
||||||
|
this.options.name = v
|
||||||
|
this.options.label.text = v
|
||||||
|
this.label && (this.label.text = v)
|
||||||
|
}
|
||||||
|
|
||||||
get color() {
|
get color() {
|
||||||
return this.options.color
|
return this.options.color
|
||||||
}
|
}
|
||||||
@ -1659,8 +1669,8 @@ class Model extends BaseModel {
|
|||||||
this.entity.minimumPixelSize = this.scaleByDistance ? undefined : this.options.minimumPixelSize
|
this.entity.minimumPixelSize = this.scaleByDistance ? undefined : this.options.minimumPixelSize
|
||||||
this.editObj && this.editObj.update()
|
this.editObj && this.editObj.update()
|
||||||
this.entity.isMove = true
|
this.entity.isMove = true
|
||||||
clearTimeout(this.#timeoutEventObject)
|
clearTimeout(this._timeoutEventObject)
|
||||||
this.#timeoutEventObject = setTimeout(() => {
|
this._timeoutEventObject = setTimeout(() => {
|
||||||
this.entity && (this.entity.isMove = false)
|
this.entity && (this.entity.isMove = false)
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,8 +60,8 @@ class GroundSvg extends Base {
|
|||||||
* @param options.customView.relativePosition.lat {number} 纬度
|
* @param options.customView.relativePosition.lat {number} 纬度
|
||||||
* @param options.customView.relativePosition.alt {number} 高度
|
* @param options.customView.relativePosition.alt {number} 高度
|
||||||
* */
|
* */
|
||||||
#loadEvent = void 0
|
// #loadEvent = void 0
|
||||||
#loaded = false
|
// #loaded = false
|
||||||
constructor(sdk, options = {}, _Dialog = {}) {
|
constructor(sdk, options = {}, _Dialog = {}) {
|
||||||
super(sdk, options);
|
super(sdk, options);
|
||||||
let jsCode = `
|
let jsCode = `
|
||||||
@ -79,6 +79,9 @@ class GroundSvg extends Base {
|
|||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
this.ismove = false;
|
this.ismove = false;
|
||||||
|
|
||||||
|
this._loadEvent = void 0
|
||||||
|
this._loaded = false
|
||||||
|
|
||||||
if (this.options.position.lat > 83.5) {
|
if (this.options.position.lat > 83.5) {
|
||||||
this.options.position.lat = 83.5
|
this.options.position.lat = 83.5
|
||||||
}
|
}
|
||||||
@ -132,7 +135,7 @@ class GroundSvg extends Base {
|
|||||||
this._isdrag = false
|
this._isdrag = false
|
||||||
this._EventBinding = new EventBinding()
|
this._EventBinding = new EventBinding()
|
||||||
|
|
||||||
if(this.sdk.entityMap.get(this.options.id)) {
|
if (this.sdk.entityMap.get(this.options.id)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.sdk.addIncetance(this.options.id, this)
|
this.sdk.addIncetance(this.options.id, this)
|
||||||
@ -148,7 +151,7 @@ class GroundSvg extends Base {
|
|||||||
this.init()
|
this.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
get type () {
|
get type() {
|
||||||
return 'GroundSvg'
|
return 'GroundSvg'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,8 +187,8 @@ class GroundSvg extends Base {
|
|||||||
set show(v) {
|
set show(v) {
|
||||||
if (typeof v === "boolean") {
|
if (typeof v === "boolean") {
|
||||||
if (this.options.text && this.options.text.show) {
|
if (this.options.text && this.options.text.show) {
|
||||||
if(this.text) {
|
if (this.text) {
|
||||||
if((!this.showView || this.showView == 3)) {
|
if ((!this.showView || this.showView == 3)) {
|
||||||
this.text.show = v
|
this.text.show = v
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -323,7 +326,7 @@ class GroundSvg extends Base {
|
|||||||
}
|
}
|
||||||
set textValue(v) {
|
set textValue(v) {
|
||||||
this.options.text.value = v
|
this.options.text.value = v
|
||||||
if(this.text) {
|
if (this.text) {
|
||||||
this.text.text = v
|
this.text.text = v
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -340,7 +343,7 @@ class GroundSvg extends Base {
|
|||||||
set textShow(v) {
|
set textShow(v) {
|
||||||
this.options.text.show = v
|
this.options.text.show = v
|
||||||
if (this.show) {
|
if (this.show) {
|
||||||
if((!this.showView || this.showView == 3)) {
|
if ((!this.showView || this.showView == 3)) {
|
||||||
this.text && (this.text.show = v)
|
this.text && (this.text.show = v)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -399,7 +402,7 @@ class GroundSvg extends Base {
|
|||||||
}
|
}
|
||||||
set textFontSize(v) {
|
set textFontSize(v) {
|
||||||
this.options.text.fontSize = v
|
this.options.text.fontSize = v
|
||||||
if(this.text) {
|
if (this.text) {
|
||||||
this.text.fontSize = v
|
this.text.fontSize = v
|
||||||
this.text.pixelOffset = v
|
this.text.pixelOffset = v
|
||||||
}
|
}
|
||||||
@ -866,7 +869,7 @@ class GroundSvg extends Base {
|
|||||||
for (let m = 0; m < this.hierarchys[i].length; m++) {
|
for (let m = 0; m < this.hierarchys[i].length; m++) {
|
||||||
let id = this.options.id + `-${i}_${m}}`
|
let id = this.options.id + `-${i}_${m}}`
|
||||||
let oldEntity = this.sdk.viewer.entities.getById(id)
|
let oldEntity = this.sdk.viewer.entities.getById(id)
|
||||||
if(oldEntity) {
|
if (oldEntity) {
|
||||||
this.sdk.viewer.entities.remove(oldEntity)
|
this.sdk.viewer.entities.remove(oldEntity)
|
||||||
}
|
}
|
||||||
let entity = this.sdk.viewer.entities.add({
|
let entity = this.sdk.viewer.entities.add({
|
||||||
@ -908,9 +911,9 @@ class GroundSvg extends Base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loaded = true
|
this.loaded = true
|
||||||
this.#loaded = true
|
this._loaded = true
|
||||||
if (this.#loadEvent) {
|
if (this._loadEvent) {
|
||||||
this.#loadEvent()
|
this._loadEvent()
|
||||||
}
|
}
|
||||||
this.scale = this.scale
|
this.scale = this.scale
|
||||||
GroundSvg.createText(this)
|
GroundSvg.createText(this)
|
||||||
@ -954,7 +957,7 @@ class GroundSvg extends Base {
|
|||||||
* @param {boolean} status=false 状态
|
* @param {boolean} status=false 状态
|
||||||
*/
|
*/
|
||||||
async edit(state) {
|
async edit(state) {
|
||||||
if (!this.#loaded) {
|
if (!this._loaded) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.originalOptions = this.deepCopyObj(this.options)
|
this.originalOptions = this.deepCopyObj(this.options)
|
||||||
@ -1210,7 +1213,7 @@ class GroundSvg extends Base {
|
|||||||
* 重置
|
* 重置
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset() {
|
||||||
if (!this.#loaded) {
|
if (!this._loaded) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.options = this.deepCopyObj(this.originalOptions)
|
this.options = this.deepCopyObj(this.originalOptions)
|
||||||
@ -1238,7 +1241,7 @@ class GroundSvg extends Base {
|
|||||||
* @param {boolean} status=false 状态
|
* @param {boolean} status=false 状态
|
||||||
*/
|
*/
|
||||||
drag(status, cd) {
|
drag(status, cd) {
|
||||||
if (!this.#loaded || !this.sdk || !this.sdk.viewer) {
|
if (!this._loaded || !this.sdk || !this.sdk.viewer) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.ismove = false
|
this.ismove = false
|
||||||
@ -1321,26 +1324,26 @@ class GroundSvg extends Base {
|
|||||||
angleH = bearing2 - bearingH
|
angleH = bearing2 - bearingH
|
||||||
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
||||||
angleW = angleW + 180
|
angleW = angleW + 180
|
||||||
flag=true
|
flag = true
|
||||||
}
|
}
|
||||||
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
||||||
angleH = angleH + 180
|
angleH = angleH + 180
|
||||||
flag2=true
|
flag2 = true
|
||||||
}
|
}
|
||||||
if(flag && flag2) {
|
if (flag && flag2) {
|
||||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(flag) {
|
if (flag) {
|
||||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
}
|
}
|
||||||
else if(flag2) {
|
else if (flag2) {
|
||||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||||
@ -1393,26 +1396,26 @@ class GroundSvg extends Base {
|
|||||||
|
|
||||||
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
||||||
angleW = angleW + 180
|
angleW = angleW + 180
|
||||||
flag=true
|
flag = true
|
||||||
}
|
}
|
||||||
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
||||||
angleH = angleH + 180
|
angleH = angleH + 180
|
||||||
flag2=true
|
flag2 = true
|
||||||
}
|
}
|
||||||
if(flag && flag2) {
|
if (flag && flag2) {
|
||||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(flag) {
|
if (flag) {
|
||||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
}
|
}
|
||||||
else if(flag2) {
|
else if (flag2) {
|
||||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||||
@ -1597,11 +1600,11 @@ class GroundSvg extends Base {
|
|||||||
|
|
||||||
this.ScreenSpaceEventHandler.setInputAction((movement) => {
|
this.ScreenSpaceEventHandler.setInputAction((movement) => {
|
||||||
this.drag(false)
|
this.drag(false)
|
||||||
if (!this._DialogObject) {
|
// if (!this._DialogObject) {
|
||||||
cd && cd(this.options)
|
cd && cd(this.options)
|
||||||
syncData(this.sdk, this.options.id)
|
syncData(this.sdk, this.options.id)
|
||||||
syncSplitData(this.sdk, this.options.id)
|
syncSplitData(this.sdk, this.options.id)
|
||||||
}
|
// }
|
||||||
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
|
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
|
||||||
|
|
||||||
this.pointEntityCollection = new Cesium.EntityCollection()
|
this.pointEntityCollection = new Cesium.EntityCollection()
|
||||||
@ -1628,7 +1631,7 @@ class GroundSvg extends Base {
|
|||||||
controlPoints[9] = turf.destination(point, wh, 0 + angle, options).geometry.coordinates
|
controlPoints[9] = turf.destination(point, wh, 0 + angle, options).geometry.coordinates
|
||||||
|
|
||||||
this.controlPoints = controlPoints
|
this.controlPoints = controlPoints
|
||||||
if(!this.sdk || !this.sdk.viewer) {
|
if (!this.sdk || !this.sdk.viewer) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for (let i = 0; i < this.controlPoints.length; i++) {
|
for (let i = 0; i < this.controlPoints.length; i++) {
|
||||||
@ -1706,7 +1709,7 @@ class GroundSvg extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_updateGeojson(data, x, y) {
|
_updateGeojson(data, x, y) {
|
||||||
if (!this.#loaded) {
|
if (!this._loaded) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let width = Math.abs(this.bbox[0] - this.bbox[2])
|
let width = Math.abs(this.bbox[0] - this.bbox[2])
|
||||||
@ -1727,7 +1730,7 @@ class GroundSvg extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_update() {
|
_update() {
|
||||||
if (!this.#loaded) {
|
if (!this._loaded) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let point = turf.point([this.position.lng, this.position.lat]);
|
let point = turf.point([this.position.lng, this.position.lat]);
|
||||||
@ -2110,22 +2113,22 @@ class GroundSvg extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
load(callback) {
|
load(callback) {
|
||||||
if (this.#loaded) {
|
if (this._loaded) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.#loadEvent = callback
|
this._loadEvent = callback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async remove() {
|
async remove() {
|
||||||
this._worker.onmessage = (event) => {}
|
this._worker.onmessage = (event) => { }
|
||||||
await this.sdk.removeIncetance(this.options.id)
|
await this.sdk.removeIncetance(this.options.id)
|
||||||
if (!this.entity) {
|
if (!this.entity) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.drag(false)
|
this.drag(false)
|
||||||
if(!this.sdk || !this.sdk.viewer) {
|
if (!this.sdk || !this.sdk.viewer) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.sdk.viewer.entities.remove(this.entity)
|
this.sdk.viewer.entities.remove(this.entity)
|
||||||
@ -2235,7 +2238,7 @@ class GroundSvg extends Base {
|
|||||||
else {
|
else {
|
||||||
let array = []
|
let array = []
|
||||||
for (let i = 0; i < this.controlPoints.length; i++) {
|
for (let i = 0; i < this.controlPoints.length; i++) {
|
||||||
let height = await this.getClampToHeight({lng: this.controlPoints[i][0], lat: this.controlPoints[i][1]})
|
let height = await this.getClampToHeight({ lng: this.controlPoints[i][0], lat: this.controlPoints[i][1] })
|
||||||
let cartesian = Cesium.Cartesian3.fromDegrees(this.controlPoints[i][0], this.controlPoints[i][1], height)
|
let cartesian = Cesium.Cartesian3.fromDegrees(this.controlPoints[i][0], this.controlPoints[i][1], height)
|
||||||
array.push(cartesian.x, cartesian.y, cartesian.z)
|
array.push(cartesian.x, cartesian.y, cartesian.z)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -970,13 +970,17 @@ class Tools {
|
|||||||
return canvas.toDataURL()
|
return canvas.toDataURL()
|
||||||
}
|
}
|
||||||
|
|
||||||
sampleHeightMostDetailed(positions) {
|
sampleHeightMostDetailed(positions, sdk) {
|
||||||
let cartesians = []
|
let cartesians = []
|
||||||
positions.forEach((item) => {
|
positions.forEach((item) => {
|
||||||
cartesians.push(new Cesium.Cartographic.fromDegrees(item.lng, item.lat))
|
cartesians.push(new Cesium.Cartographic.fromDegrees(item.lng, item.lat))
|
||||||
})
|
})
|
||||||
|
if (sdk) {
|
||||||
|
return sdk.viewer.scene.sampleHeightMostDetailed(cartesians)
|
||||||
|
} else {
|
||||||
return this.sdk.viewer.scene.sampleHeightMostDetailed(cartesians)
|
return this.sdk.viewer.scene.sampleHeightMostDetailed(cartesians)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flyHome(duration = 3) {
|
flyHome(duration = 3) {
|
||||||
setActiveViewer(0)
|
setActiveViewer(0)
|
||||||
|
|||||||
@ -93,21 +93,62 @@ const open = async (sdk, closeCallBack) => {
|
|||||||
legpObjectLeft.legp_search(tagData, true)
|
legpObjectLeft.legp_search(tagData, true)
|
||||||
let legpObjectRight = legp(contentElm.getElementsByClassName('right')[0], ".datalist_right")
|
let legpObjectRight = legp(contentElm.getElementsByClassName('right')[0], ".datalist_right")
|
||||||
legpObjectRight.legp_search(tagData, true)
|
legpObjectRight.legp_search(tagData, true)
|
||||||
|
|
||||||
let pickElm = contentElm.getElementsByClassName('pick')[0]
|
let pickElm = contentElm.getElementsByClassName('pick')[0]
|
||||||
let copyElm = contentElm.getElementsByClassName('copy')[0]
|
let copyElm = contentElm.getElementsByClassName('copy')[0]
|
||||||
let sourceCopyElm = contentElm.getElementsByClassName('sourceCopy')[0]
|
let sourceCopyElm = contentElm.getElementsByClassName('sourceCopy')[0]
|
||||||
let datalistLeftInput = contentElm.getElementsByClassName('datalist_left')[0].getElementsByTagName('input')[0]
|
let datalistLeftInput = contentElm.getElementsByClassName('datalist_left')[0].getElementsByTagName('input')[0]
|
||||||
datalistLeftInput.value = tagData[0].value
|
datalistLeftInput.value = tagData[0].value
|
||||||
legpObjectLeft.legp_searchActive(tagData[0].value)
|
legpObjectLeft.legp_searchActive(tagData[0].value)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let datalistRightInput = contentElm.getElementsByClassName('datalist_right')[0].getElementsByTagName('input')[0]
|
let datalistRightInput = contentElm.getElementsByClassName('datalist_right')[0].getElementsByTagName('input')[0]
|
||||||
datalistRightInput.value = tagData[0].value
|
datalistRightInput.value = tagData[0].value
|
||||||
legpObjectRight.legp_searchActive(tagData[0].value)
|
legpObjectRight.legp_searchActive(tagData[0].value)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let convertElm = contentElm.getElementsByClassName('convert')[0]
|
let convertElm = contentElm.getElementsByClassName('convert')[0]
|
||||||
let leftXElm = contentElm.getElementsByClassName('left-x')[0]
|
let leftXElm = contentElm.getElementsByClassName('left-x')[0]
|
||||||
let leftYElm = contentElm.getElementsByClassName('left-y')[0]
|
let leftYElm = contentElm.getElementsByClassName('left-y')[0]
|
||||||
let rightXElm = contentElm.getElementsByClassName('right-x')[0]
|
let rightXElm = contentElm.getElementsByClassName('right-x')[0]
|
||||||
let rightYElm = contentElm.getElementsByClassName('right-y')[0]
|
let rightYElm = contentElm.getElementsByClassName('right-y')[0]
|
||||||
|
|
||||||
|
let beforeleftVal = 'EPSG:4326'
|
||||||
|
let beforerightVal = 'EPSG:4326'
|
||||||
|
// 监听输入事件(实时触发)
|
||||||
|
datalistLeftInput.addEventListener('input', (e) => {
|
||||||
|
const newValue = e.target.value;
|
||||||
|
if (leftXElm.value && leftYElm.value) {
|
||||||
|
let result = proj.convert([{ x: Number(leftXElm.value), y: Number(leftYElm.value) }], beforeleftVal, newValue)
|
||||||
|
if (result.code === 0) {
|
||||||
|
leftXElm.value = result.points[0].x
|
||||||
|
leftYElm.value = result.points[0].y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
beforeleftVal = newValue
|
||||||
|
|
||||||
|
// 可以在这里调用legp_searchActive方法
|
||||||
|
legpObjectLeft.legp_searchActive(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
datalistRightInput.addEventListener('input', (e) => {
|
||||||
|
const newValue = e.target.value;
|
||||||
|
if (rightXElm.value && rightYElm.value) {
|
||||||
|
let result = proj.convert([{ x: Number(rightXElm.value), y: Number(rightYElm.value) }], beforerightVal, newValue)
|
||||||
|
if (result.code === 0) {
|
||||||
|
rightXElm.value = result.points[0].x
|
||||||
|
rightYElm.value = result.points[0].y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
beforerightVal = datalistRightInput.value
|
||||||
|
// 可以在这里调用legp_searchActive方法
|
||||||
|
legpObjectRight.legp_searchActive(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
pickElm.addEventListener('click', () => {
|
pickElm.addEventListener('click', () => {
|
||||||
tip && tip.destroy()
|
tip && tip.destroy()
|
||||||
event && event.destroy()
|
event && event.destroy()
|
||||||
|
|||||||
@ -899,14 +899,14 @@
|
|||||||
|
|
||||||
.fly-roam>.content .table .tr .th:first-child,
|
.fly-roam>.content .table .tr .th:first-child,
|
||||||
.fly-roam>.content .table .tr .td:first-child {
|
.fly-roam>.content .table .tr .td:first-child {
|
||||||
flex: 0 0 95px;
|
flex: 0 0 70px;
|
||||||
width: 95px;
|
width: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fly-roam>.content .table .tr .th:nth-child(2),
|
.fly-roam>.content .table .tr .th:nth-child(2),
|
||||||
.fly-roam>.content .table .tr .td:nth-child(2) {
|
.fly-roam>.content .table .tr .td:nth-child(2) {
|
||||||
flex: 0 0 240px;
|
flex: 0 0 100px;
|
||||||
width: 240px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fly-roam>.content .table .tr .th:last-child,
|
.fly-roam>.content .table .tr .th:last-child,
|
||||||
|
|||||||
Reference in New Issue
Block a user