diff --git a/README.md b/README.md index 289d814..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,82 +0,0 @@ -## 图层切换树组件配置文件说明 - -``` -treeConfig.json: 主页及其二级页面图层切换树结构,具体可以看现有示例。 - { - homePage: [ //homePage、positionEquipment、airspace... :主页及其二级页面名称 - { - "name": "全部" //名称:全部、阵地设备、... (必须) - "show": false //初始化显隐状态 (必须) - "icon": "qb.png" //图标,位置在views/mapControl/map/map.js (必须) - "type": "all" //带表该节点为全部,勾选时会将其他所有节点选中状态 (非必须) - "apiParam": "1" //存在apiParam节点则认为该节点的所有子节点是通过请求接口数据,请求参数为1 (非必须) - "children": [] //二级节点,该节点不需要通过请求时,可配置静态节点,如二三维度,行政区划图层等(非必须) - "legendOptions": { //图例配置,当该节点及其子节点中展示状态时,展示图例内容(非必须) - "legendData": [//图例数据 - { - "name": "适飞空域", //图例名称 - "color": "rgba(126, 192, 80, 1)" //图例颜色,颜色或图标二选一 - "icon": "qb.png" //图例图标,颜色或图标二选一 - } - ] - } - } - ] - } - - mapLayer.json: 请求回来的节点数据,配置图层样式及气泡等内容 - { - "1": [ //图层接口请求参数对应的图层样式 - "name": "反制设备", //要与接口请求回来的节点名称一直 - "show": true, //现有状态 - "children": [ //子节点 - { - "name": "全向干扰", //子节点名称,要与接口返回对应 - "show": true, //显隐状态 - "popup": { //气泡配置 - "templateName": "positionTemplate", //要使用的气泡模板 - "width": 310, //气泡宽度 - "height": 170 //气泡高度 - }, - "render": { //图层专题展示 - "type": "simple", //简单专题,symbol数组类型时key代表数据中字段,value代表值,对象类型则有数据源中存在空间数据就行.其他类型还有circleWave(覆盖范围圆)、heatMap(热力图)、administrativeRegion(行政区划)、2D(二维)、3D(三维)等,详细看示例 - "symbol": [ - { - "key": "onlineStatus", //数据中的字段 - "value": "0", //字段的值 - "type": "point", //点类型 - "style": { //点样式 - "url": "fzsb-qxgr.png", //点图标 - "width": 36, //图标宽度 - "height": 53 //图标高度 - } - }, - { - "key": "onlineStatus", - "value": "1", - "type": "point", - "style": { - "url": "fzsb-qxgr-off.png", - "width": 36, - "height": 53 - } - } - ] - } - } - ] - ] - } - -mapLayer.json -type是数据类型 circleWave(圆) point(点) -symbol是数组 里面有在线和离线的图标 通过value来区分 - -treeConfig.json -节点带apiParam,代表该节点的内容要通过请求覆盖 -legendOptions是在图层上面展示图例 -名字是根据不同的二级页面 展示不同的图层内容 -在图层增加数据时 需要在所有同样的二级菜单下增加相同的数据 -``` - -在iframe里面部署之后 根据配置更改的字段标识 ***_*** \ No newline at end of file diff --git a/src/api/home.js b/src/api/home.js index 5326667..4f8cb90 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -1,7 +1,7 @@ import request from "@/utils/request"; export function Homeview(data) { - let url = "/api/Home/view"; + let url = "/api/Home/index"; return request({ url: url, method: "get", diff --git a/src/assets/img/uav.svg b/src/assets/img/uav.svg new file mode 100644 index 0000000..cf4531f --- /dev/null +++ b/src/assets/img/uav.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/img/uavimg.png b/src/assets/img/uavimg.png new file mode 100644 index 0000000..0cbc80b Binary files /dev/null and b/src/assets/img/uavimg.png differ diff --git a/src/components/myEcharts.vue b/src/components/myEcharts.vue index 539d21b..698efc8 100644 --- a/src/components/myEcharts.vue +++ b/src/components/myEcharts.vue @@ -82,11 +82,11 @@ export default { ] }); - // 阵地统计 + // 防区统计 const directionRadar = echarts.init(this.$refs.directionRadar); directionRadar.setOption({ title: { - text: "阵地统计", + text: "防区统计", left: "center", // 颜色 textStyle: { @@ -102,7 +102,7 @@ export default { }, series: [ { - name: "阵地", + name: "防区", type: "pie", radius: "50%", data: this.chartData.position diff --git a/src/components/myMars.vue b/src/components/myMars.vue index 6c6a767..3ed2a44 100644 --- a/src/components/myMars.vue +++ b/src/components/myMars.vue @@ -103,21 +103,29 @@ export default { // eslint-disable-next-line no-undef property.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD; + const app_property = new Cesium.SampledPositionProperty(); + // eslint-disable-next-line no-undef + app_property.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD; + let start; let stop; for (let i = 0, len = mapList.length; i < len; i++) { const item = mapList[i]; const lng = Number(item.lon); // 经度 const lat = Number(item.lat); // 纬度 + const app_lng = Number(item.app_lon); // 经度 + const app_lat = Number(item.app_lat); // 纬度 const height = item.alt || 5; // 高度5 是避免与geojson高度冲突 const outputDate = item.createTime.replace(" ", "T"); const time = outputDate; // 时间 let position = null; + let app_position = null; if (lng !== 0 && lat !== 0) { if (lng && lat) { // eslint-disable-next-line no-undef position = Cesium.Cartesian3.fromDegrees(lng, lat, height); + app_position = Cesium.Cartesian3.fromDegrees(app_lng, app_lat, 0); } let juliaDate = null; if (time) { @@ -127,6 +135,9 @@ export default { if (position && juliaDate) { property.addSample(juliaDate, position); } + if (app_position && juliaDate) { + app_property.addSample(juliaDate, app_position); + } if (i === 0) { start = juliaDate; @@ -166,7 +177,7 @@ export default { position: property, orientation: new Cesium.VelocityOrientationProperty(property), billboard: { - image: require("@/views/mapControl/img/yj1.png"), + image: require("@/assets/img/uav.svg"), scale: 0.5, minimumPixelSize: 30, distanceDisplayCondition_far: 1000000, @@ -185,6 +196,35 @@ export default { }); this.graphicLayer.addGraphic(pathEntity); } + // 飞手位置 + let app_pathEntity = this.graphicLayer.getGraphicById( + "pathIdsss" + "_app" + ); + if (!app_pathEntity) { + app_pathEntity = new mars3d.graphic.ModelEntity({ + id: "pathIdsss" + "_app", + position: app_property, + orientation: new Cesium.VelocityOrientationProperty(app_property), + point: { + color: "#00ffff", + pixelSize: 8, + outlineColor: "#ffffff", + outlineWidth: 2 + }, + path: { + width: 2, + color: "#FF0000" + }, + style: { + label: { + text: "飞手位置", + font_size: 14, + font_family: "微软雅黑" + } + } + }); + this.graphicLayer.addGraphic(app_pathEntity); + } }, clearDraw() { if (this.graphics) { diff --git a/src/views/contentData/LeftSidebar/index.vue b/src/views/contentData/LeftSidebar/index.vue index 8d3d4d3..8290066 100644 --- a/src/views/contentData/LeftSidebar/index.vue +++ b/src/views/contentData/LeftSidebar/index.vue @@ -11,21 +11,25 @@