# leaflet.smoothpolygons

> Leaflet.js canvas layer with Paper.js vector smooth polygons

Latest version **0.1.1** (published 2020-03-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install leaflet.smoothpolygons
pnpm add leaflet.smoothpolygons
yarn add leaflet.smoothpolygons
bun add leaflet.smoothpolygons
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-03-24 |
| First published | 2020-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 53.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Sanchez Weezer & Smirnov |
| Maintainers | sanchezweezer |
| Keywords | smooth, polygons, polygon, leaflet, leaflet.js, paper.js |

## Links

- npm: https://www.npmjs.com/package/leaflet.smoothpolygons
- Repository: https://github.com/sanchezweezer/Leaflet.SmoothPolygons
- Homepage: https://github.com/sanchezweezer/Leaflet.SmoothPolygons#readme
- Issues: https://github.com/sanchezweezer/Leaflet.SmoothPolygons/issues
- npm.io page: https://npm.io/package/leaflet.smoothpolygons

## Dependencies (2)

- [paper](https://npm.io/package/paper.md) ^0.12.3
- [leaflet-geometryutil](https://npm.io/package/leaflet-geometryutil.md) ^0.9.1

## Recent versions

- 0.1.1 (latest) — 2020-03-24
- 0.1.0 — 2020-03-24

## README

# Leaflet.SmoothPolygons

A simple and fast [Leaflet](http://leafletjs.com) canvas smooth polygons plugin.
Uses [paperJS](http://paperjs.org/) under the hood to draw paths on canvas.

## Demo

- [Smooth polygons demo &rarr;](https://sanchezweezer.github.io/Leaflet.SmoothPolygons/docs)

## Basic Usage

```js
const polygonLayer = L.smoothPolygonsLayer().addTo(map);

const smoothPolygon = polygonLayer.addToScene({
  polygon: {
    data: [
      {
        Value, // Long on which it is necessary to recede from the center
        Direction // Angle from upper border by clock wise
      } // ,...
    ]
  },
  centralPoint: [lat, lng] // L.LanLng
});
```

To include the plugin, just use `leaflet-smooth-poly.js` from the `dist` folder:

```html
<script src="leaflet-smooth-poly.js"></script>
```

## Requirements

- [Leaflet](https://leafletjs.com/) ^1.5.0
- [Leaflet-geometryutil](http://makinacorpus.github.io/Leaflet.GeometryUtil/) ^0.9.1
- [Paper](http://paperjs.org/) ^0.12.3

## Reference

#### L.smoothPolygonsLayer(options)

Return Object of class

You can pass defaults option to all paths that you add.

#### L.smoothPolygonsLayer().addTo(map)

Connect with map and Constructs a canvas for polygons layer on map. All Options

#### Methods

- **setOptions(options)**: Sets new heatmap options and redraws it.
- **addLatLng(latlng)**: Adds a new point to the heatmap and redraws it.
- **setLatLngs(latlngs)**: Resets heatmap data and redraws it.
- **redraw()**: Redraws the heatmap.

## Changelog

#### 1.0.0 &mdash; Dec 30, 2019

- Initial release.

## License

[MIT License](https://github.com/sanchezweezer/Leaflet.SmoothPolygons/blob/master/LICENSE)

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