From 6094c0ed1baa40ffa0ce587704660b2a6d493bbf Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期一, 25 七月 2022 19:15:38 +0800
Subject: [PATCH] #D

---
 src/views/doublePreventAction/riskLevelManage/fourColorMap/sixty/index.vue |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/src/views/doublePreventAction/riskLevelManage/fourColorMap/sixty/index.vue b/src/views/doublePreventAction/riskLevelManage/fourColorMap/sixty/index.vue
index 3cf2945..7f2ad45 100644
--- a/src/views/doublePreventAction/riskLevelManage/fourColorMap/sixty/index.vue
+++ b/src/views/doublePreventAction/riskLevelManage/fourColorMap/sixty/index.vue
@@ -1,8 +1,8 @@
 <template>
-    
+
     <div class="map-layout">
         <Map @init="init" :option="option" v-if="option" />
-        <Tab v-if="loaded" :type='type' :colorMapList='colorMapList'/>
+        <Tab v-if="loaded" :type='type' :colorMapList='colorMapList' @getList="testLoaded"/>
     </div>
 
 
@@ -17,6 +17,7 @@
         Cartesian3_to_WGS84,
     } from '../../../../../components/Map/libs/Point';
     import { getMap } from '@/api/fourColorMap'
+    import {getLabel} from "../../../../../api/fourColorMap";
     export default {
         name: 'App',
         components: {
@@ -73,7 +74,8 @@
 
                 map.addModel({
                     link: 'http://222.92.213.22:8006/b3dm60/tileset.json',
-                    name: '60吨模型图',
+                    name: '60万吨模型图',
+                    modifyZ: -1340,
                     callback: tileset => {
                         var boundingSphere = tileset.boundingSphere;
                         var cartographic = Cesium.Cartographic.fromCartesian(
@@ -112,17 +114,47 @@
                 this.initEvent(map);
 
                 this.testLoadedData();
+                this.loadLabel()
+            },
+            loadLabel(){
+                const map = global.map;
+                if (!map) return;
+                let date = new Date()
+                let list = []
+                let fourMapList = {
+                    type: "FeatureCollection",
+                    features: [{
+                        type: "Feature",
+                        properties: {
+                            "type": "billboard",
+                            "style": { "image": "../../../../../../public/images/wet.png", "scale": 0.25 },
+                            "attr": {
+                                "name": "垃圾车",
+                                "id": "1a9c592a-8290-49ad-a23c-6ff92f841f78"
+                            }
+                        },
+                        geometry: {
+                            "type": "Point",
+                            "coordinates": [81.78196, 41.835623, 118.26]
+                        }
+                    }]
+                }
+                let time = date.getFullYear()+ '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + (date.getHours()-2) + ':' + date.getMinutes() + ':' + date.getSeconds()
+                getLabel(time).then(res=> {
+                    fourMapList.features[0].geometry.coordinates = []
+                })
+                map.loadGeoJSON(fourMapList)
             },
             // 加载测试数据
             testLoadedData() {
                 const map = global.map;
                 if (!map) return;
                 const params = {}
-        
+
                 params['eType'] = 1
                 getMap(params).then(res =>{
                     let list = []
-                    let fourMapList = []
+                    let fourMapList = {}
                     this.colorMapList = res.data.result
                     list = res.data.result.map(item =>{
                         return{
@@ -141,6 +173,18 @@
                     // });
                 })
             },
+            testLoaded() {
+                const map = global.map;
+                if (!map) return;
+                let params = {}
+                params['eType'] = 2
+                getMap(params).then(res => {
+                    this.colorMapList = JSON.parse(JSON.stringify(res.data.result))
+                })
+                // $.get('./public/data/plots_namisuo.geojson', res => {
+                //     map.loadGeoJSON(res);
+                // });
+            },
             initEvent(map) {
                 let popup = null;
                 const _this = this;
@@ -158,14 +202,14 @@
                             popup.destroy();
                             popup = null;
                         }
-        
+
                         let type = entity && entity.attribute && entity.attribute.type;
                         if (type) {
                             popup = new wutu3d.DivPoint(map.viewer, {
                                 html:
                                     "<div class='popup-wrapper'>" +
                                     attr.name +
-                                    '<br/><br/>XXXXXXXX</div>',
+                                    '</div>',
                                 position: cartesian3,
                                 anchor: [-170, -80],
                             });

--
Gitblit v1.9.2