Commit 294792dc authored by zhengjiangtao's avatar zhengjiangtao

fix map bug

parent e6adbd81
......@@ -166,6 +166,14 @@
height: vh(600);
position: relative;
.div-map-echarts {
margin-left: 10%;
height: 89% !important;
width: 74% !important;
top: 6%;
}
.statistics-banner {
position: absolute;
left: vw(95);
......@@ -176,6 +184,8 @@
justify-content: space-between;
z-index: 2;
.statistics-banner-content {
height: vh(100);
width: vw(380);
......@@ -222,6 +232,8 @@
}
}
}
}
.risk-trend-view {
......
import React, { Component } from 'react';
import echarts from 'echarts/lib/echarts';
import ReactEcharts from 'amos-viz/lib/echarts';
//此项必须导入,否则地图无法显示
import 'echarts/map/js/china';
import { dataList, dmtData } from './../../../../_mock/rczsData/geo';
import CommonCard from '../../../common/commonCard/CommonCard';
......@@ -16,7 +17,7 @@ class Statistics extends Component {
}
componentDidMount() {
this.initalECharts();
}
getOption = () =>{
......@@ -116,14 +117,6 @@ class Statistics extends Component {
}
initalECharts() {
var myChart = echarts.init(document.getElementById('mainMap'));
myChart.setOption(this.getOption());
myChart.on('click', function(params) {
alert(params.name);
});
}
convert() {
return '1';
}
......@@ -187,7 +180,8 @@ class Statistics extends Component {
</div>
</div>
{/* <MapChart option={option123} style={{ height: '100%', width: '100%' }} /> */}
<div id="mainMap" style={{ width: '90%', height: '86%', margin: '0 auto', paddingTop: '3%' }}></div>
<ReactEcharts option={this.getOption()} className="div-map-echarts" />
</CommonCard>
</div>
);
......
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