Shows symbols on the extremities of a Polyline, using SVG markers.
Check out the demo !
Works with Leaflet 0.7 and 1.x. Extremities are drawn with SVG markers, so lines rendered on a canvas get none.
To display dots at the extremities of a Polyline:
var layer = L.polyLine(...);
layer.showExtremities('dotM');There is currently 5 types of markers:
stopM: perpendicular linesquareM: squaredotM: dotdotL: large dotarrowM: arrow
- Support Leaflet 1.x: extremities are drawn in the SVG element holding the line (#14)
showExtremities()replaces the markers of the line instead of adding new ones, andshowExtremities(null)hides them- Declare Leaflet as a peer dependency (
leaflet >=0.7 <2)
- Create the defs node before the paths (#10)
