關(guān)鍵詞:leaflet-omnivore; WKT; 格式轉(zhuǎn)換
Loads & converts CSV, KML, GPX, TopoJSON, WKT formats for Leaflet.
在leaflet項目中寺晌,遇到后端傳來的WKT數(shù)據(jù),需將該數(shù)據(jù)渲染到地圖中瞎疼,由于leaflet尚未直接提供WKT數(shù)據(jù)的圖層加載功能耘沼,因此在官網(wǎng)上找到該插件進(jìn)行格式轉(zhuǎn)換絮吵。官方資源地址:leaflet-omnivore
Mapbox Plugins CDN:
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.3.1/leaflet-omnivore.min.js'></script>
BootCDN:
<script src="https://cdn.bootcdn.net/ajax/libs/leaflet-omnivore/0.3.4/leaflet-omnivore.js"></script>
官網(wǎng)未直接提供leaflet-omnivore.min.js
文件丽旅,需要下載項目后打包,本人已經(jīng)下載打包别洪,供有需求的朋友下載。百度網(wǎng)盤下載地址:鏈接: https://pan.baidu.com/s/1Ed_TVo_fLtkOQ07a-Q_5hw 提取碼: b3cp