Forráskód Böngészése

在线地图按钮变亮,每个场站的风机颜色不一样

zy 2 éve
szülő
commit
871009df89

BIN
neim-ui/public/img/fengji/fengjiblue.png


BIN
neim-ui/public/img/fengji/fengjigreen.png


BIN
neim-ui/public/img/fengji/fengjiyellow.png


BIN
neim-ui/public/largeScreenImg/kaiguan.png


BIN
neim-ui/public/largeScreenImg/tupian.png


+ 1 - 1
neim-ui/src/views/largeScreenPage/Subpage/provincialEnergyStations.vue

@@ -161,7 +161,7 @@ export default {
   methods: {
     getInfo() {
       getStationSeat().then(res=>{
-        console.log(res.data)
+        // console.log(res.data)
         this.allStationSeat = res.data
         this.mapValue = {
           params:new Date(),

+ 56 - 32
neim-ui/src/views/largeScreenPage/components/3DbigeMap.vue

@@ -13,13 +13,13 @@ export default {
   props: {mapValue: Object},
   watch: {
     mapValue: {
-     immediate: true,
+      immediate: true,
       handler(value) {
         if (value.params !== undefined) {
           // console.log("3D地形图:" + value)
           this.mapData = value
           this.level = value.level
-          this.center = {lng:value.center[1],lat:value.center[0]}
+          this.center = {lng: value.center[1], lat: value.center[0]}
           this.init()
         }
 
@@ -44,12 +44,12 @@ export default {
       //  高度
       let altitude = this.C * Math.pow((this.A - this.D) / (this.level - this.D) - 1, 1 / this.B)
       // console.log(this.C * Math.pow((this.A - this.D) / (this.level - this.D) - 1, 1 / this.B))
-      let center = this.center === []?[129.64920, 46.2844]:[this.center.lng,this.center.lat];
+      let center = this.center === [] ? [129.64920, 46.2844] : [this.center.lng, this.center.lat];
       bigemap3d.then(() => {
         // var center = [104.73673266358675,31.463626972537455];
         // console.log(center, 154);
         // window.bmgl.Config.HTTP_URL ='http://www.bigemap.com:9000';
-        window.bmgl.Config.HTTP_URL = process.env.VUE_APP_GIS_API;
+        window.bmgl.Config.HTTP_URL = 'http://49.4.78.194:17143';
         // window.bmgl.Config.HTTP_URL = 'http://localhost:9000';
         let viewer = new bmgl.Viewer('container', {
           // mapId: 'bigemap.zhongkexingtu',
@@ -127,9 +127,9 @@ export default {
             //将笛卡尔坐标转换为地理坐标
             var cartographic = window.bmgl.Cartographic.fromCartesian(cartesian);
             longitudeString = window.bmgl.Math.toDegrees(cartographic.longitude);
-              //.toFixed(3);
+            //.toFixed(3);
             latitudeString = window.bmgl.Math.toDegrees(cartographic.latitude);
-              //.toFixed(3);
+            //.toFixed(3);
             //获取相机高度
             height = Math.ceil(viewer.camera.positionCartographic.height);
             mouse_state.innerText =
@@ -137,8 +137,8 @@ export default {
           } else {
             mouse_state.innerText = '';
           }
-          _self.level =  Math.round(_self.D + (_self.A - _self.D) / (1 + Math.pow(height / _self.C, _self.B)));
-          _self.center = {lng:window.bmgl.Math.toDegrees(p.latitude),lat:window.bmgl.Math.toDegrees(p.longitude)};
+          _self.level = Math.round(_self.D + (_self.A - _self.D) / (1 + Math.pow(height / _self.C, _self.B)));
+          _self.center = {lng: window.bmgl.Math.toDegrees(p.latitude), lat: window.bmgl.Math.toDegrees(p.longitude)};
           _self.$emit('changeZoom', _self.level)
           // console.log(_self.level,_self.center)
         }, window.bmgl.ScreenSpaceEventType.LEFT_DOWN);
@@ -152,7 +152,7 @@ export default {
             lat: window.bmgl.Math.toDegrees(p.latitude)
           };
           // 高度转化成2D的地图级别
-          _self.level =  Math.round(_self.D + (_self.A - _self.D) / (1 + Math.pow(height / _self.C, _self.B)));
+          _self.level = Math.round(_self.D + (_self.A - _self.D) / (1 + Math.pow(height / _self.C, _self.B)));
           _self.center = position;
           _self.$emit('changeZoom', _self.level)
           // console.log(_self.level,_self.center)
@@ -162,8 +162,8 @@ export default {
         viewer.camera.changed.addEventListener(function (e) {
           // console.log("event");
           var p = window.bmgl.Cartographic.fromCartesian(viewer.camera.position);
-          _self.level =  Math.round(_self.D + (_self.A - _self.D) / (1 + Math.pow(p.height / _self.C, _self.B)));
-          _self.center = {lng:window.bmgl.Math.toDegrees(p.latitude),lat:window.bmgl.Math.toDegrees(p.longitude)};
+          _self.level = Math.round(_self.D + (_self.A - _self.D) / (1 + Math.pow(p.height / _self.C, _self.B)));
+          _self.center = {lng: window.bmgl.Math.toDegrees(p.latitude), lat: window.bmgl.Math.toDegrees(p.longitude)};
           _self.$emit('changeZoom', _self.level)
           // console.log(_self.level,_self.center)
           // console.log("-----------");
@@ -173,17 +173,42 @@ export default {
         // 渲染所有风机、塔、拐点标记点位
         // console.log(this.mapData.allPointInfo)
         if (this.mapData.allPointInfo !== null && this.mapData.allPointInfo !== undefined) {
-
+          let image = [{
+            billboard:{
+              heightReference: bmgl.HeightReference.CLAMP_TO_GROUND,
+              image: '/img/fengji.png',
+              scale: 0.6
+            }
+          },{
+            billboard:{
+              heightReference: bmgl.HeightReference.CLAMP_TO_GROUND,
+              image: '/img/fengji/fengjiblue.png',
+              scale: 0.2
+            }
+          },{
+            billboard:{
+              heightReference: bmgl.HeightReference.CLAMP_TO_GROUND,
+              image: '/img/fengji/fengjiyellow.png',
+              scale: 0.2
+            }
+          },{
+            billboard:{
+              heightReference: bmgl.HeightReference.CLAMP_TO_GROUND,
+              image: '/img/fengji/fengjigreen.png',
+              scale: 0.2
+            }
+          }]
           let data = this.mapData.allPointInfo
-          for (let item of data.fan) {
-            viewer.entities.add({
-              position: bmgl.Cartesian3.fromDegrees(Number(item.longitudeFan), Number(item.latitudeFan)),
-              billboard:{
-                heightReference: bmgl.HeightReference.CLAMP_TO_GROUND,
-                image:'/img/fengji.png',
-                scale: 0.6
-              },
-            });
+          let i = 0
+          for (let fan of data.fan) {
+            if(i>3) i = 0
+            for (let item of fan.data) {
+              viewer.entities.add({
+                position: bmgl.Cartesian3.fromDegrees(Number(item.longitudeFan), Number(item.latitudeFan)),
+                billboard: image[i].billboard
+              });
+            }
+            i++;
           }
           for (let coordinatesList of data.coordinatesList) {
             for (let item of coordinatesList) {
@@ -196,7 +221,7 @@ export default {
                 viewer.entities.add({
                   polygon: {
                     hierarchy: bmgl.Cartesian3.fromDegreesArray(latlngs),
-                    extrudedHeight:0,
+                    extrudedHeight: 0,
                     perPositionHeight: true,
                     material: bmgl.Color.CYAN.withAlpha(0.1),
                     outline: true,
@@ -214,22 +239,22 @@ export default {
           for (let item of data.towerList) {
             let marker = viewer.entities.add({
               position: bmgl.Cartesian3.fromDegrees(Number(item.longitude), Number(item.latitude)),
-              billboard:{
+              billboard: {
                 heightReference: bmgl.HeightReference.CLAMP_TO_GROUND,
-                image:'/largeScreenImg/project.png',
+                image: '/largeScreenImg/project.png',
                 scale: 0.15
               },
             });
             // 悬浮动作
             // marker.on('mouseover', function (e) {
             //   console.log(item)
-              // if (item.type === 'project') {
-              //   marker.bindTooltip('<div>测风塔名称:' + item.towerName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
-              //     {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
-              // } else {
-              //   marker.bindTooltip('<div>测风塔名称:' + item.towerName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
-              //     {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
-              // }
+            // if (item.type === 'project') {
+            //   marker.bindTooltip('<div>测风塔名称:' + item.towerName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
+            //     {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+            // } else {
+            //   marker.bindTooltip('<div>测风塔名称:' + item.towerName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
+            //     {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+            // }
 
             // })
             // marker.on('mouseout', function () {
@@ -267,7 +292,6 @@ export default {
             // })
 
 
-
           }
         }
       })

+ 97 - 36
neim-ui/src/views/largeScreenPage/components/bigeHeatMap.vue

@@ -212,8 +212,8 @@ export default {
           }).addTo(this.bMap);
           window.geo2 = geo2;
           //限制拖动
-          this.bMap.setMaxBounds(geo2.getBounds());
-          this.bMap.fitBounds(geo2.getBounds());
+          this.bMap.setMaxBounds([[43.42301,124.174976],[53.561657,135.086264]]);
+          this.bMap.fitBounds([[43.42301,124.174976],[53.561657,135.086264]]);
 
           const layers = geo2.getLayers();
           for (const item of layers) {
@@ -239,6 +239,9 @@ export default {
         let gfbconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guangfuban.png'
         let gfsconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guang.png'
         let gfhfconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/huafuguangfu.png'
+        let fengjiblue = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiblue.png'
+        let fengjigreen = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjigreen.png'
+        let fengjiyellow = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiyellow.png'
         // 所有场站标记点位
         if (this.mapData.allStationInfo !== null && this.mapData.allStationInfo !== undefined) {
           let data = this.mapData.allStationInfo
@@ -364,12 +367,26 @@ export default {
             iconAnchor: [30, 50],
             className: 'stationIcon',
           })
+          let hf_gfstation_icon = window.BM.icon({
+            iconUrl: gfhfconurl,
+            iconSize: [30, 50],
+            iconAnchor: [30, 50],
+          })
           for (let item of data) {
             let coordinate = [Number(item.latitude), Number(item.longitude)]
-            let marker = window.BM.marker(coordinate, {
-              icon: station_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+            let marker = ''
+            if (item.type === '风') {
+              marker = window.BM.marker(coordinate, {
+                icon: station_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            } else {
+              marker = window.BM.marker(coordinate, {
+                icon: hf_gfstation_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            }
+
             // 悬浮动作
             marker.on('mouseover', function (e) {
               marker.bindTooltip('<div>场站名称:' + item.stationName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
@@ -388,6 +405,7 @@ export default {
           }
         }
         // 所有风机、塔、拐点标记点位
+        // console.log(this.mapData.allPointInfo)
         if (this.mapData.allPointInfo !== null && this.mapData.allPointInfo !== undefined) {
           let data = this.mapData.allPointInfo
           let station_icon = window.BM.icon({
@@ -396,35 +414,78 @@ export default {
             iconAnchor: [35, 55],
             className: 'stationIcon',
           })
-          let fj_icon = window.BM.icon({
-            iconUrl: fjIconurl,
-            iconSize: [30, 30],
-            iconAnchor: [30, 30],
-            className: 'stationIcon',
-          })
-          for (let item of data.fan) {
-            let coordinate = [Number(item.latitudeFan), Number(item.longitudeFan)]
-            let marker = window.BM.marker(coordinate, {
-              icon: fj_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+          let fj_icon = [{
+            icon: window.BM.icon({
+              iconUrl: fjIconurl,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiblue,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjigreen,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiyellow,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          }]
+          let i = 0
+          for (let fan of data.fan) {
+            if(i>3) i = 0
+            for (let item of fan.data) {
+              let coordinate = [Number(item.latitudeFan), Number(item.longitudeFan)]
+              let marker = window.BM.marker(coordinate, {
+                icon: fj_icon[i].icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+              marker.on('mouseover', function (e) {
+                // console.log(item)
+                if (fan.type === 'project') {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                } else {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                }
+
+              })
+              marker.on('mouseout', function () {
+                marker.bindTooltip().closeTooltip();
+              })
+            }
+            i++
           }
-          for(let coordinatesList of data.coordinatesList){
-            for(let item of coordinatesList){
-              if(item.length>0){
-                let latlngs = []
-                for (let coor of item){
-                  latlngs.push([Number(coor.latitude),Number(coor.longitude)])
-                  window.BM.marker([Number(coor.latitude),Number(coor.longitude)]).addTo(this.bMap);
+          for (let coordinatesList of data.coordinatesList) {
+            for (let key in coordinatesList) {
+              let coordinates = coordinatesList[key]
+              for (let item of coordinates) {
+                if (item.length > 0) {
+                  let latlngs = []
+                  for (let coor of item) {
+                    latlngs.push([Number(coor.latitude), Number(coor.longitude)])
+                    window.BM.marker([Number(coor.latitude), Number(coor.longitude)]).addTo(this.bMap);
+                  }
+                  var polygon = BM.polygon(latlngs).addTo(this.bMap);
+                  polygon.bindTooltip(key, {permanent: true, className: 'infoToolTip', offset: [0, 0]}).openTooltip();
+                  // 让地图适配当前的线段
+                  this.bMap.fitBounds(polygon.getBounds());
                 }
-                // 拐点可以增加弹窗吗?
-                var polygon = BM.polygon(latlngs).addTo(this.bMap);
-                // polygon.on('mouseover',function (e){
-                //   polygon.bindTooltip('拐点坐标',{permanent:true});
-                // })
-                // 让地图适配当前的线段
-                this.bMap.fitBounds(polygon.getBounds());
               }
+
             }
           }
           // 项目或者场站id
@@ -450,11 +511,11 @@ export default {
             marker.on('mouseout', function () {
               marker.bindTooltip().closeTooltip();
             })
-            console.log(item.projectId)
-            let projectId = item.projectId.find(w=>w.id===id)
+            // console.log(item.projectId)
+            let projectId = item.projectId.find(w => w.id === id)
             // 点击动作
             marker.on('click', function (e) {
-              if(projectId !== undefined && projectId !== null){
+              if (projectId !== undefined && projectId !== null) {
                 if (projectId.type === 'project') {
                   let project = {projectId: id, equipmentNo: item.towerNo}
                   sessionStorage.setItem("emailWindTowerInfo", JSON.stringify(project))
@@ -466,7 +527,7 @@ export default {
                   _self.$store.dispatch('equipmentInfo/realWindTowerInfo', JSON.stringify(station))
                   _self.$router.push({path: "/homepage/realResourcesInfo"})
                 }
-              }else{
+              } else {
                 if (item.projectId[0].type === 'project') {
                   let project = {projectId: item.projectId[0].id, equipmentNo: item.towerNo}
                   sessionStorage.setItem("emailWindTowerInfo", JSON.stringify(project))

+ 105 - 39
neim-ui/src/views/largeScreenPage/components/bigeHeatSunMap.vue

@@ -207,9 +207,10 @@ export default {
           }).addTo(this.bMap);
           window.geo2 = geo2;
           //限制拖动
-          this.bMap.setMaxBounds(geo2.getBounds());
-          this.bMap.fitBounds(geo2.getBounds());
-
+          // this.bMap.setMaxBounds(geo2.getBounds());
+          // this.bMap.fitBounds(geo2.getBounds());
+          this.bMap.setMaxBounds([[43.42301,124.174976],[53.561657,135.086264]]);
+          this.bMap.fitBounds([[43.42301,124.174976],[53.561657,135.086264]]);
           const layers = geo2.getLayers();
           for (const item of layers) {
             const layer = item.feature;
@@ -233,6 +234,9 @@ export default {
         let gfbconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guangfuban.png'
         let gfsconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guang.png'
         let gfhfconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/huafuguangfu.png'
+        let fengjiblue = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiblue.png'
+        let fengjigreen = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjigreen.png'
+        let fengjiyellow = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiyellow.png'
         // 所有场站标记点位
         if (this.mapData.allStationInfo !== null && this.mapData.allStationInfo !== undefined) {
           let data = this.mapData.allStationInfo
@@ -343,65 +347,127 @@ export default {
             iconUrl: sIconurl,
             iconSize: [30, 50],
             iconAnchor: [30, 50],
-            className:'stationIcon',
+            className: 'stationIcon',
+          })
+          let hf_gfstation_icon = window.BM.icon({
+            iconUrl: gfhfconurl,
+            iconSize: [30, 50],
+            iconAnchor: [30, 50],
           })
           for (let item of data) {
             let coordinate = [Number(item.latitude), Number(item.longitude)]
-            let marker = window.BM.marker(coordinate, {
-              icon: station_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+            let marker = ''
+            if (item.type === '风') {
+              marker = window.BM.marker(coordinate, {
+                icon: station_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            } else {
+              marker = window.BM.marker(coordinate, {
+                icon: hf_gfstation_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            }
+
             // 悬浮动作
             marker.on('mouseover', function (e) {
               marker.bindTooltip('<div>场站名称:' + item.stationName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
-                {permanent:true,className:'infoToolTip',offset:[0,-30]}).openTooltip();
+                {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
             })
             marker.on('mouseout', function () {
               marker.bindTooltip().closeTooltip();
             })
             // 点击动作
             marker.on('click', function (e) {
-              let station = {id: item.id,stationName: item.stationName}
-              sessionStorage.setItem("stationInfo",JSON.stringify(station))
-              _self.$store.dispatch('equipmentInfo/stationInfo',JSON.stringify(station))
+              let station = {id: item.id, stationName: item.stationName}
+              sessionStorage.setItem("stationInfo", JSON.stringify(station))
+              _self.$store.dispatch('equipmentInfo/stationInfo', JSON.stringify(station))
               _self.$router.push({path: "/homepage/stationInfo"})
             })
           }
         }
         // 所有风机、塔、拐点标记点位
+        // console.log(this.mapData.allPointInfo)
         if (this.mapData.allPointInfo !== null && this.mapData.allPointInfo !== undefined) {
           let data = this.mapData.allPointInfo
           let station_icon = window.BM.icon({
             iconUrl: pIconurl,
             iconSize: [35, 55],
             iconAnchor: [35, 55],
-            className:'stationIcon',
+            className: 'stationIcon',
           })
-          let fj_icon = window.BM.icon({
-            iconUrl: fjIconurl,
-            iconSize: [30, 30],
-            iconAnchor: [30, 30],
-            className:'stationIcon',
-          })
-          for(let item of data.fan){
-            let coordinate = [Number(item.latitudeFan),Number(item.longitudeFan)]
-            let marker = window.BM.marker(coordinate,{
-              icon: fj_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+          let fj_icon = [{
+            icon: window.BM.icon({
+              iconUrl: fjIconurl,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiblue,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjigreen,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiyellow,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          }]
+          let i = 0
+          for (let fan of data.fan) {
+            if(i>3) i = 0
+            for (let item of fan.data) {
+              let coordinate = [Number(item.latitudeFan), Number(item.longitudeFan)]
+              let marker = window.BM.marker(coordinate, {
+                icon: fj_icon[i].icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+              marker.on('mouseover', function (e) {
+                // console.log(item)
+                if (fan.type === 'project') {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                } else {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                }
+
+              })
+              marker.on('mouseout', function () {
+                marker.bindTooltip().closeTooltip();
+              })
+            }
+            i++
           }
-          for(let coordinatesList of data.coordinatesList){
-            for(let item of coordinatesList){
-              if(item.length>0){
-                let latlngs = []
-                for (let coor of item){
-                  latlngs.push([Number(coor.latitude),Number(coor.longitude)])
-                  window.BM.marker([Number(coor.latitude),Number(coor.longitude)]).addTo(this.bMap);
+          for (let coordinatesList of data.coordinatesList) {
+            for (let key in coordinatesList) {
+              let coordinates = coordinatesList[key]
+              for (let item of coordinates) {
+                if (item.length > 0) {
+                  let latlngs = []
+                  for (let coor of item) {
+                    latlngs.push([Number(coor.latitude), Number(coor.longitude)])
+                    window.BM.marker([Number(coor.latitude), Number(coor.longitude)]).addTo(this.bMap);
+                  }
+                  var polygon = BM.polygon(latlngs).addTo(this.bMap);
+                  polygon.bindTooltip(key, {permanent: true, className: 'infoToolTip', offset: [0, 0]}).openTooltip();
+                  // 让地图适配当前的线段
+                  this.bMap.fitBounds(polygon.getBounds());
                 }
-                var polygon = BM.polygon(latlngs).addTo(this.bMap);
-                // 让地图适配当前的线段
-                this.bMap.fitBounds(polygon.getBounds());
               }
+
             }
           }
           // 项目或者场站id
@@ -427,11 +493,11 @@ export default {
             marker.on('mouseout', function () {
               marker.bindTooltip().closeTooltip();
             })
-            console.log(item.projectId)
-            let projectId = item.projectId.find(w=>w.id===id)
+            // console.log(item.projectId)
+            let projectId = item.projectId.find(w => w.id === id)
             // 点击动作
             marker.on('click', function (e) {
-              if(projectId !== undefined && projectId !== null){
+              if (projectId !== undefined && projectId !== null) {
                 if (projectId.type === 'project') {
                   let project = {projectId: id, equipmentNo: item.towerNo}
                   sessionStorage.setItem("emailWindTowerInfo", JSON.stringify(project))
@@ -443,7 +509,7 @@ export default {
                   _self.$store.dispatch('equipmentInfo/realWindTowerInfo', JSON.stringify(station))
                   _self.$router.push({path: "/homepage/realResourcesInfo"})
                 }
-              }else{
+              } else {
                 if (item.projectId[0].type === 'project') {
                   let project = {projectId: item.projectId[0].id, equipmentNo: item.towerNo}
                   sessionStorage.setItem("emailWindTowerInfo", JSON.stringify(project))

+ 81 - 31
neim-ui/src/views/largeScreenPage/components/bigeMap.vue

@@ -156,21 +156,10 @@ export default {
             });
           }).addTo(this.bMap);
           window.geo2 = geo2;
-          // let temp =
-          // {
-          //   "_southWest": {
-          //   "lat": 43.36512572875844,
-          //     "lng": 120.10253906250001
-          // },
-          //   "_northEast": {
-          //   "lat": 49.724479188712984,
-          //     "lng": 141.19628906250003
-          // }
-          // }
-          console.log(geo2.getBounds())
+          // console.log(geo2.getBounds())
           //限制拖动
-          this.bMap.setMaxBounds(geo2.getBounds());
-          this.bMap.fitBounds(geo2.getBounds());
+          this.bMap.setMaxBounds([[43.42301,124.174976],[53.561657,135.086264]]);
+          this.bMap.fitBounds([[43.42301,124.174976],[53.561657,135.086264]]);
 
           const layers = geo2.getLayers();
           for (const item of layers) {
@@ -203,6 +192,9 @@ export default {
         let hfSIconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/huafuStation.png'
         let pIconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/project.png'
         let fjIconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji.png'
+        let fengjiblue = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiblue.png'
+        let fengjigreen = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjigreen.png'
+        let fengjiyellow = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiyellow.png'
         let gfbconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guangfuban.png'
         let gfsconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guang.png'
         let gfhfconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/huafuguangfu.png'
@@ -331,12 +323,27 @@ export default {
             iconAnchor: [30, 50],
             className: 'stationIcon',
           })
+          let hf_gfstation_icon = window.BM.icon({
+            iconUrl: gfhfconurl,
+            iconSize: [30, 50],
+            iconAnchor: [30, 50],
+          })
+          console.log(data)
           for (let item of data) {
             let coordinate = [Number(item.latitude), Number(item.longitude)]
-            let marker = window.BM.marker(coordinate, {
-              icon: station_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+            let marker = ''
+            if (item.type === '风') {
+              marker = window.BM.marker(coordinate, {
+                icon: station_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            } else {
+              marker = window.BM.marker(coordinate, {
+                icon: hf_gfstation_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            }
+
             // 悬浮动作
             marker.on('mouseover', function (e) {
               marker.bindTooltip('<div>场站名称:' + item.stationName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
@@ -355,6 +362,7 @@ export default {
           }
         }
         // 所有风机、塔、拐点标记点位
+        // console.log(this.mapData.allPointInfo)
         if (this.mapData.allPointInfo !== null && this.mapData.allPointInfo !== undefined) {
           let data = this.mapData.allPointInfo
           let station_icon = window.BM.icon({
@@ -363,23 +371,65 @@ export default {
             iconAnchor: [35, 55],
             className: 'stationIcon',
           })
-          let fj_icon = window.BM.icon({
-            iconUrl: fjIconurl,
-            iconSize: [30, 30],
-            iconAnchor: [30, 30],
-            className: 'stationIcon',
-          })
-          for (let item of data.fan) {
-            let coordinate = [Number(item.latitudeFan), Number(item.longitudeFan)]
-            let marker = window.BM.marker(coordinate, {
-              icon: fj_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+          let fj_icon = [{
+            icon: window.BM.icon({
+              iconUrl: fjIconurl,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiblue,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjigreen,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiyellow,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          }]
+          let i = 0
+          for (let fan of data.fan) {
+            if(i>3) i = 0
+            for (let item of fan.data) {
+              let coordinate = [Number(item.latitudeFan), Number(item.longitudeFan)]
+              let marker = window.BM.marker(coordinate, {
+                icon: fj_icon[i].icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+              marker.on('mouseover', function (e) {
+                // console.log(item)
+                if (fan.type === 'project') {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                } else {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                }
+
+              })
+              marker.on('mouseout', function () {
+                marker.bindTooltip().closeTooltip();
+              })
+            }
+            i++
           }
           for (let coordinatesList of data.coordinatesList) {
             for (let key in coordinatesList) {
               let coordinates = coordinatesList[key]
-              for(let item of coordinates){
+              for (let item of coordinates) {
                 if (item.length > 0) {
                   let latlngs = []
                   for (let coor of item) {

+ 134 - 38
neim-ui/src/views/largeScreenPage/components/zaiXianBigeMap.vue

@@ -62,12 +62,20 @@ export default {
       let _self = this
       bigemap.then(() => {
         // window.BM.Config.HTTP_URL = 'http://www.bigemap.com:9000';
-        window.BM.Config.HTTP_URL = 'http://49.4.78.194:17143';
+
+        window.BM.Config.HTTP_URL = process.env.VUE_APP_GIS_API;
+        let ip1 = process.env.VUE_APP_GIS_API;
+        let ip2 = 'http://49.4.78.194:17143';
+
+        // window.BM.Config.HTTP_URL = 'http://49.4.78.194:17143';
+        // let ip1 = 'http://49.4.78.194:17143';
+        // let ip2 = 'http://49.4.78.194:17143';
+        let mapid = 'bigemap.zaixiantianditu'
         // window.BM.Config.HTTP_URL = 'http://192.168.1.181:9000';
         // arcgis-satellite
         // amap-satellite
         // zhongkexingtu
-        let map = window.BM.map('map', 'bigemap.zaixiantianditu', {
+        let map = window.BM.map('map', null, {
         // let map = window.BM.map('map', 'bigemap.6914xxtx', {
           center: [30, 104],
           minZoom: 6,
@@ -76,6 +84,33 @@ export default {
           attributionControl: false,
           preferCanvas: true, //适用于数据量大时 地图反应速度加快
         });
+        var promise = fetch(`${ip1}/tokens/v1?access_token=none`).then(function (response) {
+          return response.json();
+        }).then(function (body) {
+          return body.token
+        }).then(
+          (token) => {
+            var CanvasLayer = BM.GridLayer.extend({
+              createTile: function (coords, done) {
+                let error;
+                let {
+                  x,
+                  y,
+                  z
+                } = coords;
+                let tile = new Image;
+                tile.style.backgroundColor = 'inherit';
+                tile.src = `${ip2}/${mapid}/tiles/${z}/${x}/${y}.png?access_token=${token}`
+                setTimeout(function () {
+                  done(error, tile);
+                  return null
+                }, 1000);
+                return tile;
+              }
+            });
+            new CanvasLayer().addTo(map);
+          }
+        )
         window.Bmap=map;
         this.bMap=map;
         //首尾需要一致
@@ -116,8 +151,8 @@ export default {
           }).addTo(this.bMap);
           window.geo2=geo2;
           //限制拖动
-          this.bMap.setMaxBounds(geo2.getBounds());
-          this.bMap.fitBounds(geo2.getBounds());
+          this.bMap.setMaxBounds([[43.42301,124.174976],[53.561657,135.086264]]);
+          this.bMap.fitBounds([[43.42301,124.174976],[53.561657,135.086264]]);
 
           const layers = geo2.getLayers();
           for (const item of layers) {
@@ -151,6 +186,9 @@ export default {
         let gfbconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guangfuban.png'
         let gfsconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/guang.png'
         let gfhfconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/huafuguangfu.png'
+        let fengjiblue = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiblue.png'
+        let fengjigreen = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjigreen.png'
+        let fengjiyellow = 'http://' + _self.href.split("//")[1].split("/")[0] + '/img/fengji/fengjiyellow.png'
         // 所有场站标记点位
         if (this.mapData.allStationInfo !== null && this.mapData.allStationInfo !== undefined) {
           let data = this.mapData.allStationInfo
@@ -263,12 +301,26 @@ export default {
             iconAnchor: [30, 50],
             className: 'stationIcon',
           })
+          let hf_gfstation_icon = window.BM.icon({
+            iconUrl: gfhfconurl,
+            iconSize: [30, 50],
+            iconAnchor: [30, 50],
+          })
           for (let item of data) {
             let coordinate = [Number(item.latitude), Number(item.longitude)]
-            let marker = window.BM.marker(coordinate, {
-              icon: station_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+            let marker = ''
+            if (item.type === '风') {
+              marker = window.BM.marker(coordinate, {
+                icon: station_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            } else {
+              marker = window.BM.marker(coordinate, {
+                icon: hf_gfstation_icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+            }
+
             // 悬浮动作
             marker.on('mouseover', function (e) {
               marker.bindTooltip('<div>场站名称:' + item.stationName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
@@ -287,6 +339,7 @@ export default {
           }
         }
         // 所有风机、塔、拐点标记点位
+        // console.log(this.mapData.allPointInfo)
         if (this.mapData.allPointInfo !== null && this.mapData.allPointInfo !== undefined) {
           let data = this.mapData.allPointInfo
           let station_icon = window.BM.icon({
@@ -295,35 +348,78 @@ export default {
             iconAnchor: [35, 55],
             className: 'stationIcon',
           })
-          let fj_icon = window.BM.icon({
-            iconUrl: fjIconurl,
-            iconSize: [30, 30],
-            iconAnchor: [30, 30],
-            className: 'stationIcon',
-          })
-          for (let item of data.fan) {
-            let coordinate = [Number(item.latitudeFan), Number(item.longitudeFan)]
-            let marker = window.BM.marker(coordinate, {
-              icon: fj_icon,
-              riseOnHover: true
-            }).addTo(this.bMap);
+          let fj_icon = [{
+            icon: window.BM.icon({
+              iconUrl: fjIconurl,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiblue,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjigreen,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          },{
+            icon: window.BM.icon({
+              iconUrl: fengjiyellow,
+              iconSize: [30, 30],
+              iconAnchor: [30, 30],
+              className: 'stationIcon',
+            })
+          }]
+          let i = 0
+          for (let fan of data.fan) {
+            if(i>3) i = 0
+            for (let item of fan.data) {
+              let coordinate = [Number(item.latitudeFan), Number(item.longitudeFan)]
+              let marker = window.BM.marker(coordinate, {
+                icon: fj_icon[i].icon,
+                riseOnHover: true
+              }).addTo(this.bMap);
+              marker.on('mouseover', function (e) {
+                // console.log(item)
+                if (fan.type === 'project') {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                } else {
+                  marker.bindTooltip('<div>所属场站名称:' + fan.name + '</div>' + '<div>经度:' + item.longitudeFan + '</div>' + '<div>纬度:' + item.latitudeFan + '</div>',
+                    {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
+                }
+
+              })
+              marker.on('mouseout', function () {
+                marker.bindTooltip().closeTooltip();
+              })
+            }
+            i++
           }
-          for(let coordinatesList of data.coordinatesList){
-            for(let item of coordinatesList){
-              if(item.length>0){
-                let latlngs = []
-                for (let coor of item){
-                  latlngs.push([Number(coor.latitude),Number(coor.longitude)])
-                  window.BM.marker([Number(coor.latitude),Number(coor.longitude)]).addTo(this.bMap);
+          for (let coordinatesList of data.coordinatesList) {
+            for (let key in coordinatesList) {
+              let coordinates = coordinatesList[key]
+              for (let item of coordinates) {
+                if (item.length > 0) {
+                  let latlngs = []
+                  for (let coor of item) {
+                    latlngs.push([Number(coor.latitude), Number(coor.longitude)])
+                    window.BM.marker([Number(coor.latitude), Number(coor.longitude)]).addTo(this.bMap);
+                  }
+                  var polygon = BM.polygon(latlngs).addTo(this.bMap);
+                  polygon.bindTooltip(key, {permanent: true, className: 'infoToolTip', offset: [0, 0]}).openTooltip();
+                  // 让地图适配当前的线段
+                  this.bMap.fitBounds(polygon.getBounds());
                 }
-                // 拐点可以增加弹窗吗?
-                var polygon = BM.polygon(latlngs).addTo(this.bMap);
-                // polygon.on('mouseover',function (e){
-                //   polygon.bindTooltip('拐点坐标',{permanent:true});
-                // })
-                // 让地图适配当前的线段
-                this.bMap.fitBounds(polygon.getBounds());
               }
+
             }
           }
           // 项目或者场站id
@@ -349,11 +445,11 @@ export default {
             marker.on('mouseout', function () {
               marker.bindTooltip().closeTooltip();
             })
-            console.log(item.projectId)
-            let projectId = item.projectId.find(w=>w.id===id)
+            // console.log(item.projectId)
+            let projectId = item.projectId.find(w => w.id === id)
             // 点击动作
             marker.on('click', function (e) {
-              if(projectId !== undefined && projectId !== null){
+              if (projectId !== undefined && projectId !== null) {
                 if (projectId.type === 'project') {
                   let project = {projectId: id, equipmentNo: item.towerNo}
                   sessionStorage.setItem("emailWindTowerInfo", JSON.stringify(project))
@@ -365,7 +461,7 @@ export default {
                   _self.$store.dispatch('equipmentInfo/realWindTowerInfo', JSON.stringify(station))
                   _self.$router.push({path: "/homepage/realResourcesInfo"})
                 }
-              }else{
+              } else {
                 if (item.projectId[0].type === 'project') {
                   let project = {projectId: item.projectId[0].id, equipmentNo: item.towerNo}
                   sessionStorage.setItem("emailWindTowerInfo", JSON.stringify(project))