ElemeFE / react-amap

基于 React 封装的高德地图组件。AMap Component Based On React.
https://elemefe.github.io/react-amap/articles/start
MIT License
1.04k stars 151 forks source link

如何加载海量的多边形 #78

Closed LuoTuxiu closed 6 years ago

LuoTuxiu commented 6 years ago

react-amap version

OS/Browers version

Reproduction Link

Steps to reproduce

What is Expected?

react的多边形变化能不重新渲染地图吗?

What is actually happening?

加载上千条以上的polygon,react重绘地图的时候很慢很慢,有什么办法解决?

ioslh commented 6 years ago

加载大量的 Polygon 推荐直接使用高德的 API。如下:

const mapEvents = {
  created (map) {
    // 这里调用高德的方法创建 Polygon
  }
}

// render 
<div>
  <Map events={mapEvents}/>
</div>