|
@@ -130,21 +130,26 @@ export default {
|
|
|
this.setHeatMap(this.bMap);
|
|
|
//绑定事件
|
|
|
this.bindEvents(this.bMap);
|
|
|
-
|
|
|
+ if(this.mapData.level !== null){
|
|
|
+ this.bMap.setZoom(this.mapData.level)
|
|
|
+ this.bMap.panTo(this.mapData.center)
|
|
|
+ }
|
|
|
})
|
|
|
+ let sIconurl = 'http://'+_self.href.split("//")[1].split("/")[0]+'/largeScreenImg/station.png'
|
|
|
+ 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'
|
|
|
+
|
|
|
// 所有场站标记点位
|
|
|
if(this.mapData.allStationInfo !== null && this.mapData.allStationInfo !== undefined){
|
|
|
let data = this.mapData.allStationInfo
|
|
|
- let iconurl = 'http://'+_self.href.split("//")[1].split("/")[0]+'/largeScreenImg/station.png'
|
|
|
- let hfIconurl = 'http://'+_self.href.split("//")[1].split("/")[0]+'/largeScreenImg/huafuStation.png'
|
|
|
-
|
|
|
let station_icon = window.BM.icon({
|
|
|
- iconUrl: iconurl,
|
|
|
+ iconUrl: sIconurl,
|
|
|
iconSize: [25, 43],
|
|
|
iconAnchor: [25, 43]
|
|
|
})
|
|
|
let hf_station_icon = window.BM.icon({
|
|
|
- iconUrl: hfIconurl,
|
|
|
+ iconUrl: hfSIconurl,
|
|
|
iconSize: [35, 55],
|
|
|
iconAnchor: [35, 55]
|
|
|
})
|
|
@@ -177,13 +182,12 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 项目标记点位
|
|
|
if (this.mapData.projectInfo !== null && this.mapData.projectInfo !== undefined) {
|
|
|
let data = this.mapData.projectInfo
|
|
|
- let iconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/project.png'
|
|
|
-
|
|
|
let station_icon = window.BM.icon({
|
|
|
- iconUrl: iconurl,
|
|
|
+ iconUrl: pIconurl,
|
|
|
iconSize: [30, 50],
|
|
|
iconAnchor: [30, 50]
|
|
|
})
|
|
@@ -195,7 +199,7 @@ export default {
|
|
|
}).addTo(this.bMap);
|
|
|
// 悬浮动作
|
|
|
marker.on('mouseover', function (e) {
|
|
|
- marker.bindTooltip('<div>场站名称:' + item.projectNameEasy + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
|
|
|
+ marker.bindTooltip('<div>项目名称:' + item.projectNameEasy + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
|
|
|
{permanent:true,className:'infoToolTip',offset:[0,-30]}).openTooltip();
|
|
|
})
|
|
|
marker.on('mouseout', function () {
|
|
@@ -213,10 +217,8 @@ export default {
|
|
|
// 华富场站标记点位
|
|
|
if (this.mapData.staionInfo !== null && this.mapData.staionInfo !== undefined) {
|
|
|
let data = this.mapData.staionInfo
|
|
|
- let iconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/station.png'
|
|
|
-
|
|
|
let station_icon = window.BM.icon({
|
|
|
- iconUrl: iconurl,
|
|
|
+ iconUrl: sIconurl,
|
|
|
iconSize: [30, 50],
|
|
|
iconAnchor: [30, 50],
|
|
|
className:'stationIcon',
|
|
@@ -229,7 +231,7 @@ export default {
|
|
|
}).addTo(this.bMap);
|
|
|
// 悬浮动作
|
|
|
marker.on('mouseover', function (e) {
|
|
|
- marker.bindTooltip('<div>项目名称:' + item.stationName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
|
|
|
+ marker.bindTooltip('<div>场站名称:' + item.stationName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
|
|
|
{permanent:true,className:'infoToolTip',offset:[0,-30]}).openTooltip();
|
|
|
})
|
|
|
marker.on('mouseout', function () {
|
|
@@ -244,6 +246,78 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ // 所有风机、塔、拐点标记点位
|
|
|
+ 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',
|
|
|
+ })
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ for(let item of data.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);
|
|
|
+ }
|
|
|
+ var polygon = BM.polygon(latlngs).addTo(this.bMap);
|
|
|
+ // 让地图适配当前的线段
|
|
|
+ this.bMap.fitBounds(polygon.getBounds());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let item of data.towerList) {
|
|
|
+ let coordinate = [Number(item.latitude), Number(item.longitude)]
|
|
|
+ let marker = window.BM.marker(coordinate, {
|
|
|
+ icon: station_icon,
|
|
|
+ riseOnHover: true
|
|
|
+ }).addTo(this.bMap);
|
|
|
+ // 悬浮动作
|
|
|
+ marker.on('mouseover', function (e) {
|
|
|
+ // console.log(item)
|
|
|
+ if(item.type === 'project'){
|
|
|
+ marker.bindTooltip('<div>项目名称:' + item.projectName + '</div>'+ '<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.stationName + '</div>'+ '<div>测风塔名称:' + item.towerName + '</div>' + '<div>经度:' + item.longitude + '</div>' + '<div>纬度:' + item.latitude + '</div>',
|
|
|
+ {permanent:true,className:'infoToolTip',offset:[0,-30]}).openTooltip();
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ marker.on('mouseout', function () {
|
|
|
+ marker.bindTooltip().closeTooltip();
|
|
|
+ })
|
|
|
+ // 点击动作
|
|
|
+ marker.on('click', function (e) {
|
|
|
+ if(item.type === 'project'){
|
|
|
+ let project = {projectId:item.projectId,equipmentNo:item.towerNo}
|
|
|
+ sessionStorage.setItem("emailWindTowerInfo", JSON.stringify(project))
|
|
|
+ _self.$store.dispatch('equipmentInfo/emailWindTowerInfo', JSON.stringify(project))
|
|
|
+ _self.$router.push({path: "/homepage/emailResourcesInfo"})
|
|
|
+ }else {
|
|
|
+ let station = {stationId:item.stationId,equipmentNo:item.towerNo}
|
|
|
+ sessionStorage.setItem("realWindTowerInfo", JSON.stringify(station))
|
|
|
+ _self.$store.dispatch('equipmentInfo/realWindTowerInfo', JSON.stringify(station))
|
|
|
+ _self.$router.push({path: "/homepage/realResourcesInfo"})
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
/**
|
|
|
* 加载实时气象源动画效果
|
|
|
fetch("/js/json/wind_data/20230403_00_atmoslev_1000_mb.json")
|