|
@@ -49,6 +49,7 @@ import ws from 'ws';
|
|
|
|
|
|
import Path from '../config/path_wjc.json'
|
|
|
import routeList from '../config/routeList.json'
|
|
|
+import MoveCar from '../config/moveCar.json'
|
|
|
|
|
|
import {
|
|
|
getAvoidRoute,
|
|
@@ -114,6 +115,7 @@ export default {
|
|
|
let addFlowPathEvent = null;
|
|
|
let movePointEvent = null;
|
|
|
let currentRealPowerShow = false; //当前是否显示无极网格
|
|
|
+ let getFixedFlyInstance = {};
|
|
|
let currentRealPowerIds = {
|
|
|
power_wj_15:[],
|
|
|
power_wj_16:[],
|
|
@@ -126,6 +128,7 @@ export default {
|
|
|
power_wj_23:[]
|
|
|
}; //当前无极网格
|
|
|
let currentRealPowerLevel = null; //当前无极网格层级
|
|
|
+ let popupEnabled = false;
|
|
|
onMounted(() =>{
|
|
|
bus.on('CreateMap',() =>{
|
|
|
MapReady = $.Deferred();
|
|
@@ -303,6 +306,9 @@ export default {
|
|
|
case "GetVirtualFlyPoint":
|
|
|
getVirtualFlyPoint(params);
|
|
|
break;
|
|
|
+ case "GetFixedFlyPoint":
|
|
|
+ getFixedFlyPoint(params);
|
|
|
+ break;
|
|
|
case "ChangePointStatus":
|
|
|
changePointStatus(params);
|
|
|
break;
|
|
@@ -731,6 +737,9 @@ export default {
|
|
|
if(m_handles.has(highlight_handle_id)){
|
|
|
m_handles.remove(highlight_handle_id);
|
|
|
}
|
|
|
+ if(params.popupEnabled){
|
|
|
+ popupEnabled = params.popupEnabled;
|
|
|
+ }
|
|
|
let addPointEvent = new AddPointEvent({
|
|
|
m_view,
|
|
|
type,
|
|
@@ -753,15 +762,27 @@ export default {
|
|
|
let highlightHandle = lyrView.highlight(result.graphic);
|
|
|
m_handles.add(highlightHandle,handleId);
|
|
|
})
|
|
|
- let setPopupOptions = new SetPopupOptions({
|
|
|
- title:popupTitle,
|
|
|
- location:m_view.toMap(screenPoint),
|
|
|
- content:result.graphic.attributes
|
|
|
+ if(popupEnabled){
|
|
|
+ let setPopupOptions = new SetPopupOptions({
|
|
|
+ title:popupTitle,
|
|
|
+ location:m_view.toMap(screenPoint),
|
|
|
+ content:result.graphic.attributes
|
|
|
+ })
|
|
|
+ m_view.popup.open(setPopupOptions.popupOptions());
|
|
|
+ }
|
|
|
+ bus.emit('SendMessage',{
|
|
|
+ action:"ClickResult",
|
|
|
+ data:{
|
|
|
+ "message":result.graphic.attributes
|
|
|
+ }
|
|
|
})
|
|
|
- m_view.popup.open(setPopupOptions.popupOptions());
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
function showLayersWithScaleEvents(params){
|
|
|
let status = params.status;
|
|
|
let scale_handle_id = params.scale_handle_id;
|
|
@@ -1762,7 +1783,7 @@ export default {
|
|
|
view:m_view,
|
|
|
m_map,
|
|
|
id:params.id,
|
|
|
- data:params.data
|
|
|
+ data:params.data,
|
|
|
});
|
|
|
m_map.add(geometryMeshEffect.graphicsLayer);
|
|
|
}
|
|
@@ -1956,6 +1977,55 @@ export default {
|
|
|
connectVirtualWebSocket(status);
|
|
|
}
|
|
|
|
|
|
+ function getFixedFlyPoint(params){
|
|
|
+ let status = params.status;
|
|
|
+ let data = MoveCar.paths;
|
|
|
+ let id = "fixedPath"
|
|
|
+ // let data = params.paths;
|
|
|
+ // let id = params.id;
|
|
|
+ //设置定时2秒发送data里面下一个点执行flyGltf
|
|
|
+
|
|
|
+ if (status === "show") {
|
|
|
+ // 清除已有定时器避免重复
|
|
|
+ if (getFixedFlyInstance[id]) {
|
|
|
+ clearInterval(getFixedFlyInstance[id].timerId);
|
|
|
+ getFixedFlyInstance[id].timerId = null;
|
|
|
+ getFixedFlyInstance[id] = null;
|
|
|
+ }
|
|
|
+ // 重置索引以重新开始
|
|
|
+ getFixedFlyInstance[id] = {};
|
|
|
+ getFixedFlyInstance[id].currentIndex = 0;
|
|
|
+ // 设置新定时器
|
|
|
+ getFixedFlyInstance[id].timerId = setInterval(() => {
|
|
|
+ if (getFixedFlyInstance[id].currentIndex < data.length) {
|
|
|
+ // 获取当前点并发送
|
|
|
+ debugger
|
|
|
+ let currentPoint = data[getFixedFlyInstance[id].currentIndex];
|
|
|
+ flyGLTF({
|
|
|
+ uavid:id,
|
|
|
+ status:"show",
|
|
|
+ duration:2000,
|
|
|
+ //duration:3000,
|
|
|
+ point:currentPoint
|
|
|
+ });
|
|
|
+ getFixedFlyInstance[id].currentIndex++;
|
|
|
+ } else {
|
|
|
+ // 数据发送完毕,清除定时器
|
|
|
+ clearInterval(getFixedFlyInstance[id].timerId);
|
|
|
+ getFixedFlyInstance[id].timerId = null;
|
|
|
+ getFixedFlyInstance[id] = null;
|
|
|
+ }
|
|
|
+ }, 2000); // 每2秒执行一次
|
|
|
+ } else {
|
|
|
+ // 状态非show时停止发送
|
|
|
+ if (getFixedFlyInstance[id].timerId !== null) {
|
|
|
+ clearInterval(getFixedFlyInstance[id].timerId);
|
|
|
+ getFixedFlyInstance[id].timerId = null;
|
|
|
+ getFixedFlyInstance[id] = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
function getRealFlyPoint(params){
|
|
@@ -3432,6 +3502,11 @@ export default {
|
|
|
let newShape = JSON.parse(item.shape);
|
|
|
newShape.color = "red"
|
|
|
showData.push({
|
|
|
+ attributes:{
|
|
|
+ id:item.id,
|
|
|
+ name:item.name,
|
|
|
+ height:newShape.height,
|
|
|
+ },
|
|
|
type:item.geoType,
|
|
|
shape: newShape
|
|
|
})
|