hustcc / echarts-for-react

⛳️ Apache ECharts components for React wrapper. 一个简单的 Apache echarts 的 React 封装。
https://git.hust.cc/echarts-for-react
MIT License
4.51k stars 629 forks source link

How do i use bmap? #240

Closed harunkelesoglu closed 5 years ago

harunkelesoglu commented 5 years ago

I am trying use bmap instead of geo.But map not showing for this demo .I am importing just echarts library in this way -> import ReactEcharts from 'echarts-for-react';

how can i solve this problem.

jerryyan1990 commented 5 years ago

same question @hustcc

SidKwok commented 5 years ago

Did you add bmap.js in your code base?

harunkelesoglu commented 5 years ago

Thanks @SidKwok i solved. If you still dont solve it. You can try @jerryyan1990 import ReactEcharts from 'echarts-for-react'; require('echarts/extension/bmap/bmap')

Additional you should add to index.html header <script src="https://api.map.baidu.com/getscript?v=2.0&ak=yourApiKey"></script>

But this time the map is loading slowly. How can i speed up? Is there someone who knows?

SidKwok commented 5 years ago

Did you mean the script loading time or just the paint time of charts?

harunkelesoglu commented 5 years ago

i mean script loading @SidKwok Is it possible using different maps with echarts, as google maps?

SidKwok commented 5 years ago

the servers should be deployed in China, and it may the cause network issue. I think it would be much better if you download the script and store it in your local environment. Or you can just require with webpack.