# leaflet-triangle-marker

> Draw vector triangles using fast Canvas renderer on Leaflet map.

Latest version **1.0.2** (published 2020-03-12) · MIT license · 71 weekly downloads

## Install

```sh
npm install leaflet-triangle-marker
pnpm add leaflet-triangle-marker
yarn add leaflet-triangle-marker
bun add leaflet-triangle-marker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-03-12 |
| First published | 2019-02-24 |
| Weekly downloads | 71 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Przemysław Melnarowicz |
| Maintainers | bagage |

## Links

- npm: https://www.npmjs.com/package/leaflet-triangle-marker
- Repository: https://github.com/bagage/leaflet-triangle-marker
- Homepage: https://github.com/bagage/leaflet-triangle-marker#readme
- Issues: https://github.com/bagage/leaflet-triangle-marker/issues
- npm.io page: https://npm.io/package/leaflet-triangle-marker

## Recent versions

- 1.0.2 (latest) — 2020-03-12
- 1.0.1 — 2019-02-24

## README

Leaflet TriangleMarker
================

Draw vector triangles using fast Canvas renderer (SVG renderer not supported for now) on Leaflet map. TriangleMarker is isosceles triangle with given width and height, top pointed (can be rotated).

L.TriangleMarker is based on L.CircleMarker, extension to L.Path which from inherits options and methods.

Usage
================

All options are optional as in CircleMarker, LatLng is required. Other, non listed options, events and methods inherited as in CircleMarker (from Path, Interactive layer and Layer) .

#### Creation and options

```js

var // example data
    renderer = L.canvas(),
    latLng = L.latLng(50.671062, 17.926126),
    // example marker
    myTriangleMarker = L.triangleMarker(latLng, {
        renderer:   renderer,   // your canvas renderer (default: L.canvas())
        rotation:   45,         // triangle rotation in degrees (default: 0)
        width:      12,         // width of the base of triangle (default: 24)
        height:     8,          // height of triangle (default: 24)
    })
```

#### Methods

Triangle specific methods.

```js
// rotation
myTriangleMarker.setWidth(90) // set new width in px
myTriangleMarker.getWidth() // get current width in px
// width
myTriangleMarker.setHeight(90) // set new height in px
myTriangleMarker.getHeight() // get current height in px
// height
myTriangleMarker.setRotation(90) // set new rotation in deg
myTriangleMarker.getRotation() // get current rotation in deg
```

Compatibility
================

Created and tested on Leaflet 1.3.1

---
_Source: https://npm.io/package/leaflet-triangle-marker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
