leaflet-marker-arc
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

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:

Option Type Default Description
startAngle Number 0 Arc Start angle, in degrees, clockwise.
stopAngle Number 359.9999 Arc Stop angle, in degrees, clockwise.

and the following methods:

Method Returns Description
setStartAngle(newAngle) this Sets the Arc start angle value.
setStopAngle(newAngle) this Sets the Arc stop angle value.
setDirection(direction,degrees) this Sets the direction according a given direction and an angle value.
getDirection() number Gets the direction.
isSemicircle() boolean Checks if is a Arc

Package Sidebar

Install

npm i leaflet-marker-arc

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

9.85 kB

Total Files

6

Last publish

Collaborators

  • fjcapeletto