Commit 294792dc authored by zhengjiangtao's avatar zhengjiangtao

fix map bug

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