Commit b0836c78 authored by XXM's avatar XXM

地图数据

parent ffff6e9b
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import china from "@/assets/json/china.json";
let myChart= null let myChart= null
export default { export default {
props: { props: {
...@@ -26,9 +27,7 @@ export default { ...@@ -26,9 +27,7 @@ export default {
} }
}, },
created(){ created(){
axios.get('/static/json/china.json').then((chinaJson)=>{ echarts.registerMap('china', china);
echarts.registerMap('china', chinaJson.data);
})
}, },
watch:{ watch:{
datas: function(obj) { datas: function(obj) {
...@@ -53,7 +52,7 @@ export default { ...@@ -53,7 +52,7 @@ export default {
}, },
series: [ series: [
{ {
name: '中国', name: 'china',
type: 'map', type: 'map',
map: 'china', map: 'china',
label: { label: {
...@@ -64,7 +63,6 @@ export default { ...@@ -64,7 +63,6 @@ export default {
] ]
} }
// axios.get('https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json').then((chinaJson)=>{ // axios.get('https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json').then((chinaJson)=>{
// console.log(chinaJson.data)
// echarts.registerMap('china', chinaJson.data); // echarts.registerMap('china', chinaJson.data);
// myChart.setOption(option) // myChart.setOption(option)
// }) // })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment