|
@@ -134,23 +134,21 @@ export default {
|
|
|
// this.setHeatMap(this.bMap);
|
|
|
//绑定事件
|
|
|
this.bindEvents(this.bMap);
|
|
|
- if(this.mapData.level !== null){
|
|
|
- _self.level = this.mapData.level
|
|
|
- _self.center = this.mapData.center
|
|
|
- this.bMap.setView(this.mapData.center,this.mapData.level)
|
|
|
- // this.bMap.setZoom(this.mapData.level)
|
|
|
- // this.bMap.panTo(this.mapData.center)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ setTimeout(()=>{
|
|
|
+ if (this.mapData.center.length !== 0) {
|
|
|
+ _self.level = this.mapData.level
|
|
|
+ _self.center = this.mapData.center
|
|
|
+ this.bMap.setView(this.mapData.center, this.mapData.level)
|
|
|
+ }
|
|
|
+ },500)
|
|
|
})
|
|
|
- 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 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){
|
|
|
+ if (this.mapData.allStationInfo !== null && this.mapData.allStationInfo !== undefined) {
|
|
|
let data = this.mapData.allStationInfo
|
|
|
let station_icon = window.BM.icon({
|
|
|
iconUrl: sIconurl,
|
|
@@ -162,29 +160,29 @@ export default {
|
|
|
iconSize: [35, 55],
|
|
|
iconAnchor: [35, 55]
|
|
|
})
|
|
|
- for(let item of data.otherStation){
|
|
|
- let coordinate = [Number(item.latitude),Number(item.longitude)]
|
|
|
- let marker = window.BM.marker(coordinate,{
|
|
|
+ for (let item of data.otherStation) {
|
|
|
+ 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();
|
|
|
+ {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,{
|
|
|
+ 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();
|
|
|
+ {permanent: true, className: 'infoToolTip', offset: [0, -30]}).openTooltip();
|
|
|
})
|
|
|
marker.on('mouseout', function () {
|
|
|
marker.bindTooltip().closeTooltip();
|
|
@@ -201,26 +199,28 @@ export default {
|
|
|
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);
|
|
|
- // 悬浮动作
|
|
|
- marker.on('mouseover', function (e) {
|
|
|
- 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 () {
|
|
|
- marker.bindTooltip().closeTooltip();
|
|
|
- })
|
|
|
- // 点击动作
|
|
|
- marker.on('click', function (e) {
|
|
|
- let project = {id: item.id,projectSort: item.projectName}
|
|
|
- sessionStorage.setItem("projectInfo", JSON.stringify(project))
|
|
|
- _self.$store.dispatch('equipmentInfo/projectInfo', JSON.stringify(project))
|
|
|
- _self.$router.push({path: "/homepage/projectInfo"})
|
|
|
- })
|
|
|
+ if(item.latitude !== undefined){
|
|
|
+ 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.projectNameEasy + '</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 project = {id: item.id, projectSort: item.projectName}
|
|
|
+ sessionStorage.setItem("projectInfo", JSON.stringify(project))
|
|
|
+ _self.$store.dispatch('equipmentInfo/projectInfo', JSON.stringify(project))
|
|
|
+ _self.$router.push({path: "/homepage/projectInfo"})
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 华富场站标记点位
|
|
@@ -230,7 +230,7 @@ export default {
|
|
|
iconUrl: sIconurl,
|
|
|
iconSize: [30, 50],
|
|
|
iconAnchor: [30, 50],
|
|
|
- className:'stationIcon',
|
|
|
+ className: 'stationIcon',
|
|
|
})
|
|
|
for (let item of data) {
|
|
|
let coordinate = [Number(item.latitude), Number(item.longitude)]
|
|
@@ -241,16 +241,16 @@ export default {
|
|
|
// 悬浮动作
|
|
|
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"})
|
|
|
})
|
|
|
}
|
|
@@ -262,31 +262,37 @@ export default {
|
|
|
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',
|
|
|
+ className: 'stationIcon',
|
|
|
})
|
|
|
- for(let item of data.fan){
|
|
|
- let coordinate = [Number(item.latitudeFan),Number(item.longitudeFan)]
|
|
|
- let marker = window.BM.marker(coordinate,{
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ // 拐点可以增加弹窗吗?
|
|
|
+ var polygon = BM.polygon(latlngs).addTo(this.bMap);
|
|
|
+ // polygon.on('mouseover',function (e){
|
|
|
+ // polygon.bindTooltip('拐点坐标',{permanent:true});
|
|
|
+ // })
|
|
|
+ // 让地图适配当前的线段
|
|
|
+ this.bMap.fitBounds(polygon.getBounds());
|
|
|
}
|
|
|
- var polygon = BM.polygon(latlngs).addTo(this.bMap);
|
|
|
- // 让地图适配当前的线段
|
|
|
- this.bMap.fitBounds(polygon.getBounds());
|
|
|
}
|
|
|
}
|
|
|
for (let item of data.towerList) {
|
|
@@ -298,12 +304,12 @@ export default {
|
|
|
// 悬浮动作
|
|
|
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();
|
|
|
+ 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();
|
|
|
}
|
|
|
|
|
|
})
|
|
@@ -312,13 +318,13 @@ export default {
|
|
|
})
|
|
|
// 点击动作
|
|
|
marker.on('click', function (e) {
|
|
|
- if(item.type === 'project'){
|
|
|
- let project = {projectId:item.projectId,equipmentNo:item.towerNo}
|
|
|
+ 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}
|
|
|
+ } 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"})
|