From 4d0cece6f88fa97f5e299dc450d4707d3eec534e Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 18 Jan 2022 09:51:17 +0800
Subject: [PATCH] +
---
src/store/modules/mobile.js | 56 ++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/src/store/modules/mobile.js b/src/store/modules/mobile.js
index 979e095..117f84b 100644
--- a/src/store/modules/mobile.js
+++ b/src/store/modules/mobile.js
@@ -56,6 +56,7 @@
navigationStartLngLat: "", //导航起点
navigationEndLngLat: "", //导航终点
drawALineLayer: null, //导航路径图层
+ drawALineLayerIcon: null, //导航路径图层图标
isOpenDrawALine: false, //是否开启路径
endPosition: "", //传送终点经纬度--
isendPosition: false, //传送终点经纬度--感应数据
@@ -270,6 +271,12 @@
state.isOpenDrawALine = false;
}
},
+ removerPolyLineIcon(state) {
+ if (state.drawALineLayerIcon) {
+ state.drawALineLayerIcon.remove();
+ state.drawALineLayerIcon = null;
+ }
+ },
removePolylineMany(state) {
if (state.drawALineLayerMany) {
state.drawALineLayerMany.remove();
@@ -302,7 +309,7 @@
const nowHeight = Math.ceil(
state.mviewer.camera.positionCartographic.height
);
- console.log(data);
+ // console.log(data);
if (state.dimension == "3D") {
Flys = [
+data.lntLat[0] + 0.01197,
@@ -744,22 +751,19 @@
color: color,
speed: 10,
});
- let drawALineLayer = new global.DC.VectorLayer("layer");
- state.mviewer.addLayer(drawALineLayer);
- let polyline = new global.DC.Polyline(Str); //加入绘画点
- polyline.setStyle({
- width: 3,
- material: material,
- clampToGround: true,
- });
- drawALineLayer.addOverlay(polyline);
+ state.drawALineLayer = new global.DC.VectorLayer("lineLayer");
+ state.mviewer.addLayer(state.drawALineLayer);
+
//如果是添加 给第一个点加入图标 和事件
if (value[1]) {
+ commit("removerPolyLineIcon");
+ state.drawALineLayerIcon = new global.DC.VectorLayer("pointLayer");
+ state.mviewer.addLayer(state.drawALineLayerIcon);
let post = Str.split(";")[0].split(",");
let position = new global.DC.Position(post[0], post[1]);
let billboard = new global.DC.Billboard(
position,
- "img/dingwei/dingwei4.png"
+ "img/dingwei/dingwei1.png"
); //加入绘画点
billboard.setStyle({
pixelOffset: { x: 0, y: -17 }, //偏移像素
@@ -774,15 +778,26 @@
let windowData = {
position,
lntLat,
- query: { ...(value[1] || {}), position, lntLat },
+ query: {
+ ...(value[1] || {}),
+ position,
+ lntLat,
+ notAddGoOn: "notAddGoOn",
+ },
useJWD: true, //仅使用经纬度
};
dispatch("setMobileWindows", windowData);
});
- drawALineLayer.addOverlay(billboard);
+ state.drawALineLayerIcon.addOverlay(billboard);
}
+ let polyline = new global.DC.Polyline(Str); //加入线
+ polyline.setStyle({
+ width: 3,
+ material: material,
+ clampToGround: true,
+ });
+ state.drawALineLayer.addOverlay(polyline);
- state.drawALineLayer = drawALineLayer;
state.isOpenDrawALine = true;
// commit("cameraSetView", state.navigationStartLngLat); //移动
},
@@ -791,6 +806,7 @@
//检查是否存在路线
commit("removePolylineMany");
commit("removePolyline");
+ commit("removerPolyLineIcon");
let Strs = value[0];
let red = global.DC.Namespace.Cesium.Color.fromCssColorString("#FF0000");
let white = global.DC.Namespace.Cesium.Color.fromCssColorString("#fff");
@@ -805,7 +821,7 @@
image: "img/icon/right.png",
repeat: { x: 320, y: 1 },
});
- let drawALineLayerMany = new global.DC.VectorLayer("layer");
+ let drawALineLayerMany = new global.DC.VectorLayer("manyLinePointLayer");
state.mviewer.addLayer(drawALineLayerMany);
//多条线
for (let k in Strs) {
@@ -853,7 +869,12 @@
let windowData = {
position,
lntLat,
- query: { ...(value[2] || {}), position, lntLat },
+ query: {
+ ...(value[2] || {}),
+ position,
+ lntLat,
+ notAddGoOn: "notAddGoOn",
+ },
useJWD: true, //仅使用经纬度
};
dispatch("setMobileWindows", windowData);
@@ -888,9 +909,8 @@
drawALineLayerMany.addOverlay(Labels);
// console.log(point[k]);
}
-
state.drawALineLayerMany = drawALineLayerMany;
- state.isOpenDrawALineMany = true;
+ state.isOpenDrawALineMany = value[2].name ? value[2].name : true;
// commit("cameraSetView", state.navigationStartLngLat); //移动
},
},
--
Gitblit v1.9.3