|
|
|
|
@ -83,15 +83,15 @@ export default { |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
// this.getData() |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.initMap(); |
|
|
|
|
}, 0); |
|
|
|
|
window.addEventListener('resize', () => { |
|
|
|
|
if (this.baiduMap) { |
|
|
|
|
this.backMap(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.getData() |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// this.initMap(); |
|
|
|
|
// }, 0); |
|
|
|
|
// window.addEventListener('resize', () => { |
|
|
|
|
// if (this.baiduMap) { |
|
|
|
|
// this.backMap(); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
@ -104,7 +104,6 @@ export default { |
|
|
|
|
console.log(data, '.....') |
|
|
|
|
this.markList.forEach(e => { |
|
|
|
|
data.forEach(r => { |
|
|
|
|
|
|
|
|
|
if (e.name.includes(r.name)) { |
|
|
|
|
e.carbon = r.carbon || 0 |
|
|
|
|
e.electricity = r.electricity || 0 |
|
|
|
|
@ -158,11 +157,11 @@ export default { |
|
|
|
|
// // fillOpacity: 0 |
|
|
|
|
// })) |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
BMapGLLib.AreaRestriction.setBounds(this.baiduMap, bound); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e) |
|
|
|
|
} |
|
|
|
|
// try { |
|
|
|
|
// BMapGLLib.AreaRestriction.setBounds(this.baiduMap, bound); |
|
|
|
|
// } catch (e) { |
|
|
|
|
// console.log(e) |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// bdary.get('郴州市嘉禾县', (rs) => { |
|
|
|
|
// // 绘制行政区 |
|
|
|
|
|