openlayers和leaflet:現在看,是前端地圖開源庫的唯二選擇,兩個都是將切片或者空間數據在瀏覽器中可視化,並提供與之交互的能力。
openlayers和leaflet有些許區別
leaflet專注小而美,只提供基本的地圖調用和交互,超出的基本依賴插件,插件很多,也很全;
openlayers把所有的功能做到了一起,自成一體,但保留了擴展其類的功能,全部引入太過臃腫,所以最新的openlayers提供了vue組件式開發,可以只引入需要的部分。所以,這兩個各有特點。如果只需要顯示地圖和簡單的交互,使用leaflet合適,復雜的可以嘗試使用openlayers。
leaflet :https://leafletjs.com/reference-1.7.1.html#domevent
openlayer: https://openlayers.org/en/latest/apidoc/
leaflet 聚合點
https://www.npmjs.com/package/leaflet.markercluster
npm i leaflet.markercluster
示例:https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html
風場插件
https://github.com/danwild/leaflet-velocity
示例: https://danwild.github.io/leaflet-velocity/