Draw semicircles on Leaflet maps
npm install leaflet-semicircleLeaflet-Semicircle.
-------------------
Allows drawing semicircles on leaflet maps.
It's an extension of Leaflet's L.Circle,
and behaves like L.Circle if the a semicircle of almost 360 degrees is displayed.
Updated for use with leaflet 1.1.0.
L.SemiCircle/L.SemiCircleMarkerfactories: L.semiCircle/L.SemiCircleMarker | Options: startAngle: start angle of the semicircle stopAngle: stop angle of the semicircleAngles are defined like compass courses: 0 = north, 90 = east, etc. |
L.SemiCircle.setStartAngle(angle) | Set the start angle of the circle to angle and redraw. |
L.Circle.setStopAngle(angle) | Set the stop angle of the circle to angle and redraw. |
L.Circle.setDirection(direction, size) | Set the startAngle to direction - (0.5 size) and the stopAngle to direction + (0.5 size) and redraw. |
options map and set startAngle and stopAngle.setDirection(direction, size) to display a semicircle of size degrees at direction.Using options.startAngle and options.stopAngle:
```
L.semiCircle([51.5, -0.09], {
radius: 500,
startAngle: 45,
stopAngle: 135
}).addTo(map);
Draw the same semicircle using setDirection(direction, size):``
L.semiCircle([51.5, -0.09], {radius: 500})
.setDirection(90, 90)
.addTo(map);