0.1.3 • Published 1 year ago

leaflet-marker-arc v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Leaflet Arc Marker

Enables Marker Arcs icons in Leaflet. Inspired by the previous Semicircle extension (https://github.com/jieter/Leaflet-semicircle) This version adapts the component providing the structures for TypeScript, making it easier/smoother to import to an Angular project. Tested with leaflet 1.8

npm version

npm install leaflet-marker-arc

Usage

L.arcMarker([-23.3456789, -43.4567890], {
            radius: 50,
            fill: true,
            fillColor:'#334455',
            fillOpacity: 0.5,
            color: '#334455',
            opacity: 0.5,
            startAngle: 30,
            stopAngle: 90
}).addTo(map);

var marker = new L.ArcMarker([-23.3456789, -43.4567890], {
            radius: 50,
            fill: true,
            fillColor:'#334455',
            fillOpacity: 0.5,
            color: '#334455',
            opacity: 0.5,
            startAngle: 30,
            stopAngle: 90
}).addTo(map);

API

Extends the L.CircleMarker class adding two options:

OptionTypeDefaultDescription
startAngleNumber0Arc Start angle, in degrees, clockwise.
stopAngleNumber359.9999Arc Stop angle, in degrees, clockwise.

and the following methods:

MethodReturnsDescription
setStartAngle(newAngle)thisSets the Arc start angle value.
setStopAngle(newAngle)thisSets the Arc stop angle value.
setDirection(direction,degrees)thisSets the direction according a given direction and an angle value.
getDirection()numberGets the direction.
isSemicircle()booleanChecks if is a Arc
0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago