leaflet js: draw POIs as canvas

后端 未结 2 1228
失恋的感觉
失恋的感觉 2021-02-08 12:03

I want to draw many geo points with Leaflet. Therefore I want to use HTML5 canvas to improve the performance. My datasoure is geoJSON. As I saw in the documention of Leaflet, it

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-08 12:59

    I'm Leaflet author. You can do this by using L.CircleMarker instead of regular Marker, and also using an experimental L_PREFER_CANVAS switch to render vectors as Canvas (instead of SVG), like this: https://github.com/CloudMade/Leaflet/blob/master/debug/vector/vector-canvas.html

提交回复
热议问题