|
@@ -85,7 +85,7 @@ export default {
|
|
|
color: '#ffffff',
|
|
|
weight: 3,
|
|
|
fillColor: '#ffffff',
|
|
|
- fillOpacity: 0.1
|
|
|
+ fillOpacity: 0
|
|
|
};
|
|
|
},
|
|
|
onEachFeature: function (feature, layer) {
|
|
@@ -100,14 +100,14 @@ export default {
|
|
|
color: '#ffffff',
|
|
|
weight: 1,
|
|
|
fillColor: 'transparent',
|
|
|
- fillOpacity: 0.9
|
|
|
+ fillOpacity: 0
|
|
|
});
|
|
|
}).on('mouseout', function (e) {
|
|
|
e.layer.setStyle({
|
|
|
color: '#ffffff',
|
|
|
weight: 3,
|
|
|
fillColor: '#ffffff',
|
|
|
- fillOpacity: 0.2
|
|
|
+ fillOpacity: 0
|
|
|
});
|
|
|
}).addTo(this.bMap);
|
|
|
window.geo2=geo2;
|
|
@@ -130,32 +130,66 @@ 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)
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
})
|
|
|
- // 标记点位
|
|
|
- if(this.mapData.stationInfo !== null){
|
|
|
- let data = this.mapData.stationInfo
|
|
|
- let iconurl = 'http://'+_self.href.split("//")[1].split("/")[0]+'/largeScreenImg/station.png'
|
|
|
+ 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 station_icon = window.BM.icon({
|
|
|
- iconUrl: iconurl,
|
|
|
- iconSize: [30, 50],
|
|
|
- iconAnchor: [30, 50]
|
|
|
+ iconUrl: sIconurl,
|
|
|
+ iconSize: [25, 43],
|
|
|
+ iconAnchor: [25, 43]
|
|
|
+ })
|
|
|
+ let hf_station_icon = window.BM.icon({
|
|
|
+ iconUrl: hfSIconurl,
|
|
|
+ iconSize: [35, 55],
|
|
|
+ iconAnchor: [35, 55]
|
|
|
})
|
|
|
- for(let item of data){
|
|
|
+ for(let item of data.otherStation){
|
|
|
let coordinate = [Number(item.latitude),Number(item.longitude)]
|
|
|
- window.BM.marker(coordinate,{
|
|
|
- icon: station_icon
|
|
|
+ let marker = window.BM.marker(coordinate,{
|
|
|
+ icon: station_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();
|
|
|
+ })
|
|
|
+ marker.on('mouseout', function () {
|
|
|
+ marker.bindTooltip().closeTooltip();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for(let item of data.HDStation){
|
|
|
+ let coordinate = [Number(item.latitude),Number(item.longitude)]
|
|
|
+ let marker = window.BM.marker(coordinate,{
|
|
|
+ icon: hf_station_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();
|
|
|
+ })
|
|
|
+ marker.on('mouseout', function () {
|
|
|
+ marker.bindTooltip().closeTooltip();
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- // 标记点位
|
|
|
- if (this.mapData.projectInfo !== null) {
|
|
|
- let data = this.mapData.projectInfo
|
|
|
- let iconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/project.png'
|
|
|
|
|
|
+ // 项目标记点位
|
|
|
+ if (this.mapData.projectInfo !== null && this.mapData.projectInfo !== undefined) {
|
|
|
+ let data = this.mapData.projectInfo
|
|
|
let station_icon = window.BM.icon({
|
|
|
- iconUrl: iconurl,
|
|
|
+ iconUrl: pIconurl,
|
|
|
iconSize: [30, 50],
|
|
|
iconAnchor: [30, 50]
|
|
|
})
|
|
@@ -182,6 +216,110 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ // 华富场站标记点位
|
|
|
+ if (this.mapData.staionInfo !== null && this.mapData.staionInfo !== undefined) {
|
|
|
+ let data = this.mapData.staionInfo
|
|
|
+ let station_icon = window.BM.icon({
|
|
|
+ iconUrl: sIconurl,
|
|
|
+ iconSize: [30, 50],
|
|
|
+ iconAnchor: [30, 50],
|
|
|
+ className:'stationIcon',
|
|
|
+ })
|
|
|
+ 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);
|
|
|
+ // 悬浮动作
|
|
|
+ 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();
|
|
|
+ })
|
|
|
+ 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))
|
|
|
+ this.$store.dispatch('equipmentInfo/stationInfo',JSON.stringify(station))
|
|
|
+ this.$router.push({path: "/homepage/stationInfo"})
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 所有风机、塔、拐点标记点位
|
|
|
+ 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.towerId}
|
|
|
+ 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.towerId}
|
|
|
+ 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")
|
|
@@ -267,7 +405,7 @@ export default {
|
|
|
color: '#ffffff',
|
|
|
fillColor: 'transparent',
|
|
|
weight: 1,
|
|
|
- fillOpacity: 0.9
|
|
|
+ fillOpacity: 1
|
|
|
};
|
|
|
},
|
|
|
}).on('mouseover', function (e) {
|
|
@@ -302,7 +440,7 @@ export default {
|
|
|
color: '#ffffff',
|
|
|
fillColor: 'transparent',
|
|
|
weight: 1,
|
|
|
- fillOpacity: 0.9
|
|
|
+ fillOpacity: 1
|
|
|
});
|
|
|
// 点击地图区域向下钻取
|
|
|
// }).on('click', (e) => {
|
|
@@ -335,6 +473,7 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style>
|
|
|
+
|
|
|
.infoToolTip{
|
|
|
color: white;
|
|
|
background: rgba(0, 133, 212, 0.75);
|
|
@@ -342,7 +481,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.my_tooltip{
|
|
|
- color: #0085d4;
|
|
|
+ color: white;
|
|
|
background: transparent;
|
|
|
border: none;
|
|
|
/*font-size: 18px;*/
|