Rotate marker in Leaflet

后端 未结 4 2072
天命终不由人
天命终不由人 2021-02-04 06:59

How can I rotate a marker in leaflet? I will have a lot of markers, all with a rotation angle.

I\'ve tried this solution from runanet/coomsie at Leaflet on GitH

4条回答
  •  清歌不尽
    2021-02-04 07:35

    This solution is by far the easiest: https://github.com/bbecquet/Leaflet.RotatedMarker

    Note: it only modifies the existing marker, allowing two more options (rotationAngle and rotationOrigin).

    The solution works very well. As per the GitHub page, a usage example:

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

提交回复
热议问题