You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
639 B
39 lines
639 B
|
2 years ago
|
<template>
|
||
|
|
<div id="map">
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import * as echarts from "echarts";
|
||
|
|
import "echarts-gl";
|
||
|
|
import WUXI from "@/assets/wuxi.json";
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {}
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
initMap () {
|
||
|
|
echarts.registerMap("wuxi", WUXI);
|
||
|
|
let chart = echarts.init(document.querySelector("#map"))
|
||
|
|
chart.setOption({
|
||
|
|
series: [{
|
||
|
|
type: 'map3D', // map、map3D
|
||
|
|
map: 'wuxi' // 注册的地图名称
|
||
|
|
}]
|
||
|
|
})
|
||
|
|
}
|
||
|
|
},
|
||
|
|
computed: {},
|
||
|
|
mounted() {
|
||
|
|
this.initMap()
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped lang="scss">
|
||
|
|
#map {
|
||
|
|
width: 100%;
|
||
|
|
height: 100%;
|
||
|
|
}
|
||
|
|
</style>
|