leaflet.smoothpolygons
v0.1.1
Published
Leaflet.js canvas layer with Paper.js vector smooth polygons
Downloads
12
Maintainers
Readme
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
- Leaflet ^1.5.0
- Leaflet-geometryutil ^0.9.1
- Paper ^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 — Dec 30, 2019
- Initial release.