npm.io
0.1.1 • Published 6 years ago

leaflet.smoothpolygons

Licence
MIT
Version
0.1.1
Deps
2
Size
53 kB
Vulns
0
Weekly
0
Stars
7

Leaflet.SmoothPolygons

A simple and fast Leaflet canvas smooth polygons plugin. Uses paperJS under the hood to draw paths on canvas.

Demo

Basic Usage

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:

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

Requirements

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 — Dec 30, 2019
  • Initial release.

License

MIT License

Keywords