飞行漫游
This commit is contained in:
@ -18,6 +18,14 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
if (options.repeat) {
|
if (options.repeat) {
|
||||||
repeat = Number(options.repeat)
|
repeat = Number(options.repeat)
|
||||||
}
|
}
|
||||||
|
if (options.defaultTime) {
|
||||||
|
let contentElm = document.getElementsByClassName('fly-roam')[0]
|
||||||
|
contentElm.querySelector("input[name='defaultTime']").value = options.defaultTime
|
||||||
|
}
|
||||||
|
if (options.totalTime) {
|
||||||
|
let contentElm = document.getElementsByClassName('fly-roam')[0]
|
||||||
|
contentElm.querySelector("input[name='totalTime']").value = options.totalTime
|
||||||
|
}
|
||||||
let viewer = sdk.viewer
|
let viewer = sdk.viewer
|
||||||
let tools = new Tools(sdk)
|
let tools = new Tools(sdk)
|
||||||
let active = 0
|
let active = 0
|
||||||
@ -72,6 +80,23 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
nameElm.value = name
|
nameElm.value = name
|
||||||
nameElm.addEventListener('input', () => {
|
nameElm.addEventListener('input', () => {
|
||||||
name = nameElm.value
|
name = nameElm.value
|
||||||
|
func({
|
||||||
|
name: name,
|
||||||
|
points: points,
|
||||||
|
repeat: repeat + '',
|
||||||
|
defaultTime: defaultTimeDom.value,
|
||||||
|
totalTime: totalTimeElm.value
|
||||||
|
})
|
||||||
|
})
|
||||||
|
let defaultTimeDom = contentElm.querySelector("input[name='defaultTime']")
|
||||||
|
nameElm.addEventListener('input', () => {
|
||||||
|
func({
|
||||||
|
name: name,
|
||||||
|
points: points,
|
||||||
|
repeat: repeat + '',
|
||||||
|
defaultTime: defaultTimeDom.value,
|
||||||
|
totalTime: totalTimeElm.value
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// let addListBtn = document.createElement('button');
|
// let addListBtn = document.createElement('button');
|
||||||
@ -90,7 +115,9 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
func({
|
func({
|
||||||
name: name,
|
name: name,
|
||||||
points: newPoints,
|
points: newPoints,
|
||||||
repeat: repeat + ''
|
repeat: repeat + '',
|
||||||
|
defaultTime: defaultTimeDom.value,
|
||||||
|
totalTime: totalTimeElm.value
|
||||||
})
|
})
|
||||||
// _Dialog.clickSavePath && _Dialog.clickSavePath(
|
// _Dialog.clickSavePath && _Dialog.clickSavePath(
|
||||||
// {
|
// {
|
||||||
@ -138,6 +165,14 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
points.splice(active, 0, data)
|
points.splice(active, 0, data)
|
||||||
addTrElm(data)
|
addTrElm(data)
|
||||||
i++
|
i++
|
||||||
|
|
||||||
|
func({
|
||||||
|
name: name,
|
||||||
|
points: points,
|
||||||
|
repeat: repeat + '',
|
||||||
|
defaultTime: defaultTimeDom.value,
|
||||||
|
totalTime: totalTimeElm.value
|
||||||
|
})
|
||||||
})
|
})
|
||||||
// let modifyBtn = contentElm.getElementsByClassName('modify-point')[0]
|
// let modifyBtn = contentElm.getElementsByClassName('modify-point')[0]
|
||||||
// modifyBtn.addEventListener('click', () => {
|
// modifyBtn.addEventListener('click', () => {
|
||||||
@ -184,6 +219,13 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
}
|
}
|
||||||
trList[trList.length - 1].querySelector("input[name='time']").value = 0
|
trList[trList.length - 1].querySelector("input[name='time']").value = 0
|
||||||
}
|
}
|
||||||
|
func({
|
||||||
|
name: name,
|
||||||
|
points: points,
|
||||||
|
repeat: repeat + '',
|
||||||
|
defaultTime: defaultTimeDom.value,
|
||||||
|
totalTime: totalTimeElm.value
|
||||||
|
})
|
||||||
})
|
})
|
||||||
repeatElm.checked = (repeat === Infinity ? true : false)
|
repeatElm.checked = (repeat === Infinity ? true : false)
|
||||||
repeatElm.addEventListener('change', () => {
|
repeatElm.addEventListener('change', () => {
|
||||||
@ -194,6 +236,13 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
repeat = 0
|
repeat = 0
|
||||||
}
|
}
|
||||||
currentRepeat = repeat
|
currentRepeat = repeat
|
||||||
|
func({
|
||||||
|
name: name,
|
||||||
|
points: points,
|
||||||
|
repeat: repeat + '',
|
||||||
|
defaultTime: defaultTimeDom.value,
|
||||||
|
totalTime: totalTimeElm.value
|
||||||
|
})
|
||||||
_Dialog.changeRepeatStateCallBack && _Dialog.changeRepeatStateCallBack(repeatElm.checked)
|
_Dialog.changeRepeatStateCallBack && _Dialog.changeRepeatStateCallBack(repeatElm.checked)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -260,7 +309,7 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
let modifyBtn = tr.getElementsByClassName('modify-point')[0]
|
let modifyBtn = tr.getElementsByClassName('modify-point')[0]
|
||||||
modifyBtn.addEventListener('click', () => {
|
modifyBtn.addEventListener('click', () => {
|
||||||
for (let m = 0; m < trList.length; m++) {
|
for (let m = 0; m < trList.length; m++) {
|
||||||
if (trList[m] === e_delete.parentNode.parentNode) {
|
if (trList[m] === e_delete.parentNode.parentNode.parentNode) {
|
||||||
let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
||||||
points[m].position = position
|
points[m].position = position
|
||||||
points[m].orientation = {
|
points[m].orientation = {
|
||||||
@ -277,14 +326,14 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
|
|
||||||
e_play.addEventListener('click', () => {
|
e_play.addEventListener('click', () => {
|
||||||
for (let m = 0; m < trList.length; m++) {
|
for (let m = 0; m < trList.length; m++) {
|
||||||
if (trList[m] === e_delete.parentNode.parentNode) {
|
if (trList[m] === e_play.parentNode.parentNode.parentNode) {
|
||||||
flyTo(sdk, points, m)
|
flyTo(sdk, points, m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
e_delete.addEventListener("click", (v) => {
|
e_delete.addEventListener("click", (v) => {
|
||||||
for (let m = 0; m < trList.length; m++) {
|
for (let m = 0; m < trList.length; m++) {
|
||||||
if (trList[m] === e_delete.parentNode.parentNode) {
|
if (trList[m] === e_delete.parentNode.parentNode.parentNode) {
|
||||||
points.splice(m, 1)
|
points.splice(m, 1)
|
||||||
points[points.length - 1] && (points[points.length - 1].duration = 0)
|
points[points.length - 1] && (points[points.length - 1].duration = 0)
|
||||||
tableBody.removeChild(tr)
|
tableBody.removeChild(tr)
|
||||||
@ -322,6 +371,14 @@ const open = async (sdk, options = {}, _Dialog = {}, func) => {
|
|||||||
// if (trList.length > 0) {
|
// if (trList.length > 0) {
|
||||||
// trList[trList.length - 1].querySelector("input[name='time']").disabled = 'disabled'
|
// trList[trList.length - 1].querySelector("input[name='time']").disabled = 'disabled'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
func({
|
||||||
|
name: name,
|
||||||
|
points: points,
|
||||||
|
repeat: repeat + '',
|
||||||
|
defaultTime: defaultTimeDom.value,
|
||||||
|
totalTime: totalTimeElm.value
|
||||||
|
})
|
||||||
})
|
})
|
||||||
e_time.addEventListener('input', (v) => {
|
e_time.addEventListener('input', (v) => {
|
||||||
isTotalTimeElm.checked = false
|
isTotalTimeElm.checked = false
|
||||||
|
|||||||
Reference in New Issue
Block a user