|
@@ -223,13 +223,15 @@ export default {
|
|
|
//绑定事件
|
|
|
this.bindEvents(this.bMap);
|
|
|
})
|
|
|
- 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'
|
|
|
-
|
|
|
+ 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/huafugf.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,
|
|
@@ -238,32 +240,59 @@ export default {
|
|
|
})
|
|
|
let hf_station_icon = window.BM.icon({
|
|
|
iconUrl: hfSIconurl,
|
|
|
- iconSize: [35, 55],
|
|
|
- iconAnchor: [35, 55]
|
|
|
+ iconSize: [33, 55],
|
|
|
+ iconAnchor: [33, 55]
|
|
|
})
|
|
|
- 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);
|
|
|
+ let gfstation_icon = window.BM.icon({
|
|
|
+ iconUrl: gfsconurl,
|
|
|
+ iconSize: [25, 43],
|
|
|
+ iconAnchor: [25, 43]
|
|
|
+ })
|
|
|
+ let hf_gfstation_icon = window.BM.icon({
|
|
|
+ iconUrl: gfhfconurl,
|
|
|
+ iconSize: [33, 55],
|
|
|
+ iconAnchor: [33, 55]
|
|
|
+ })
|
|
|
+ for (let item of data.otherStation) {
|
|
|
+ let coordinate = [Number(item.latitude), Number(item.longitude)]
|
|
|
+ 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: 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();
|
|
|
})
|
|
|
}
|
|
|
- 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);
|
|
|
+ for (let item of data.HDStation) {
|
|
|
+ let coordinate = [Number(item.latitude), Number(item.longitude)]
|
|
|
+ let marker = '';
|
|
|
+ if(item.type === '风'){
|
|
|
+ marker = window.BM.marker(coordinate, {
|
|
|
+ icon: hf_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();
|
|
@@ -484,6 +513,7 @@ export default {
|
|
|
//添加一个缩放事件
|
|
|
map.on('zoomend', function (e) {
|
|
|
_self.level = this.getZoom()
|
|
|
+ _self.$emit('changeZoom', this.getZoom())
|
|
|
document.getElementById('zoom').innerHTML = '当前级别 : ' + this.getZoom();
|
|
|
});
|
|
|
},
|