Leaflet之marker旋轉


Leaflet之marker旋轉

在leaflet本身的api中,maker沒有設置旋轉的配置項。

如果想對maker進行旋轉設置,需要引用外部包:leaflet-rotatedmarker

api:https://github.com/bbecquet/Leaflet.RotatedMarker

npm:npm install leaflet-rotatedmarker

使用方法:

L.marker([48.8631169, 2.3708919], {
    rotationAngle: 45
}).addTo(map);

注:也可以將js文件(leaflet.rotatedMarker.js)直接引用至頁面中使用:

<script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
<script type="text/javascript" src="../js/leaflet.rotatedMarker.js"></script>

 

 

鑽研不易,轉載請注明出處、、、、、、

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM