slutske22 / leaflet-arrowheads

A small plugin for leaflet to quickly draw arrowheads on polylines for vector visualization
https://codesandbox.io/s/leaflet-arrowheads-example-zfxxc
MIT License
158 stars 29 forks source link

Midline offsetfor arrowhead #46

Open BethencourtFlorian opened 3 months ago

BethencourtFlorian commented 3 months ago

For now, the offset option can only take a given offset from the start or the end of the line in either meters or pixels. But is it possible to write something like var polyline = L.polyline(latlngs).arrowheads({offsets: {end: '50%'}}) ? Or maybe a way to get the polyline length and calculate an offset from there ? Thanks in advance

slutske22 commented 3 months ago

Currently a % offset is not available. I'm out of bandwidth, but if you want to take a crack at it and open a PR, go for it