修改
This commit is contained in:
@ -12,8 +12,8 @@ let repeat = 0
|
||||
let currentRepeat = 0
|
||||
|
||||
|
||||
const open = async (sdk, options = {}, _Dialog = {}) => {
|
||||
let name = options.name || '飞线漫游'
|
||||
const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
||||
let name = options.name || '漫游路径'
|
||||
options.points || (options.points = [])
|
||||
if (options.repeat) {
|
||||
repeat = Number(options.repeat)
|
||||
@ -74,8 +74,9 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
||||
name = nameElm.value
|
||||
})
|
||||
|
||||
let addListBtn = document.createElement('button');
|
||||
addListBtn.innerHTML = '保存'
|
||||
// let addListBtn = document.createElement('button');
|
||||
let addListBtn = document.getElementsByClassName('saveRoam')[0];
|
||||
// addListBtn.innerHTML = '保存'
|
||||
addListBtn.addEventListener('click', () => {
|
||||
if (!name) {
|
||||
name = '漫游路径'
|
||||
@ -85,6 +86,12 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
||||
points.map((item) => {
|
||||
newPoints.push(item)
|
||||
})
|
||||
|
||||
func({
|
||||
name: name,
|
||||
points: newPoints,
|
||||
repeat: repeat + ''
|
||||
})
|
||||
// _Dialog.clickSavePath && _Dialog.clickSavePath(
|
||||
// {
|
||||
// name: name,
|
||||
@ -124,20 +131,20 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
||||
addTrElm(data)
|
||||
i++
|
||||
})
|
||||
let modifyBtn = contentElm.getElementsByClassName('modify-point')[0]
|
||||
modifyBtn.addEventListener('click', () => {
|
||||
if (!active) {
|
||||
return
|
||||
}
|
||||
let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
||||
points[active - 1].position = position
|
||||
points[active - 1].orientation = {
|
||||
heading: viewer.camera.heading,
|
||||
pitch: viewer.camera.pitch,
|
||||
roll: viewer.camera.roll
|
||||
}
|
||||
tools.message({ text: '操作成功' })
|
||||
})
|
||||
// let modifyBtn = contentElm.getElementsByClassName('modify-point')[0]
|
||||
// modifyBtn.addEventListener('click', () => {
|
||||
// if (!active) {
|
||||
// return
|
||||
// }
|
||||
// let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
||||
// points[active - 1].position = position
|
||||
// points[active - 1].orientation = {
|
||||
// heading: viewer.camera.heading,
|
||||
// pitch: viewer.camera.pitch,
|
||||
// roll: viewer.camera.roll
|
||||
// }
|
||||
// tools.message({ text: '操作成功' })
|
||||
// })
|
||||
|
||||
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
||||
let isTotalTimeElm = contentElm.querySelector("input[name='isTotalTime']")
|
||||
@ -287,11 +294,13 @@ const open = async (sdk, options = {}, _Dialog = {}) => {
|
||||
// }
|
||||
})
|
||||
e_time.addEventListener('input', (v) => {
|
||||
console.log(isTotalTimeElm, 'isTotalTimeElm')
|
||||
isTotalTimeElm.checked = false
|
||||
data.duration = Number(e_time.value)
|
||||
if (data.duration < 0) {
|
||||
data.duration = 0
|
||||
}
|
||||
console.log(data.duration, 'duration')
|
||||
})
|
||||
e_time.addEventListener('blur', () => {
|
||||
e_time.value = Number(Number(e_time.value).toFixed(2))
|
||||
@ -325,6 +334,7 @@ const close = () => {
|
||||
}
|
||||
|
||||
const executeFlyTo = (sdk, points = [], index = 0, noStart) => {
|
||||
console.log(noStart, points, 'noStart')
|
||||
if (clickHandler) {
|
||||
clickHandler.destroy()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user