leafelt-geoman-styleeditor插件集成
時間 2021-01-22
標籤
webGis
leaflet
style
繪製
圖形
gis
leafelt-geoman-styleeditor
https://github.com/weizhixiang/leafelt-geoman-styleeditor
集成以下三個leaflet插件
- https://github.com/geoman-io/leaflet-geoman
- https://github.com/dwilhelm89/Leaflet.StyleEditor
- https://github.com/makinacorpus/Leaflet.TextPath
感謝原作者創造如此美好的插件!
- 在Leaflet.StyleEditor中增加了監聽geoman創建新圖形的接口,使得創建完圖形即可設置樣式,
- 在leaflet-geoman中修改了默認marker圖標,使得與Leaflet.StyleEditor默認圖標一致,
- 在leaflet-geoman中添加一種單線段,可在上面顯示距離,距離計算使用的leaflet默認方法的distanceTo,長距離計算是否按大地線,請自行研究
- 因爲引入Leaflet.TextPath,所有polyline類型的圖形即可繼承Leaflet.TextPath方法樣式設置沿線文字
- 繼承以上三個插件中所有events,請自行查看源文檔
- demo中的index.html簡單示例