# leafletjs-canvas-overlay

> An npm wrapper for Leaflet Canvas Overlay, by Sumbera https://github.com/Sumbera

Latest version **1.0.1** (published 2016-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install leafletjs-canvas-overlay
pnpm add leafletjs-canvas-overlay
yarn add leafletjs-canvas-overlay
bun add leafletjs-canvas-overlay
```

## 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.1 |
| Published | 2016-07-14 |
| First published | 2016-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | https://github.com/Sumbera |
| Maintainers | danwild |
| Keywords | leaflet, leafletjs, canvas |

## Links

- npm: https://www.npmjs.com/package/leafletjs-canvas-overlay
- Repository: https://github.com/danwild/leafletjs-canvas-overlay
- Homepage: https://gist.github.com/1ce9fb8891bf187450f882261730b4a8
- Issues: https://gist.github.com/1ce9fb8891bf187450f882261730b4a8
- npm.io page: https://npm.io/package/leafletjs-canvas-overlay

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-07-14
- 1.0.0 — 2016-06-27

## README

Leaflet Full view Canvas Overlay - straightforward full screen canvas overlay that calls custom user function for drawing.
Mostly extracted from [here](https://github.com/Leaflet/Leaflet.heat) added resize and few other parameters for callback
Compare to same data SVG rendering [here](http://bl.ocks.org/Sumbera/7e8e57368175a1433791)

		//Example:
		L.canvasOverlay()
		   .params({data: points})     // optional add any custom data that will be passed to draw function
	           .drawing(drawingOnCanvas)   // set drawing function
	           .addTo(leafletMap);         // add this layer to leaflet map
	            

		//Custom drawing function:
			function drawingOnCanvas(canvasOverlay, params) {
		            var ctx = params.canvas.getContext('2d');
		            params.options.data.map(function (d, i) {
		              // canvas drawing goes here
		            });
		        };
		        
		// parameters passed to custom draw function :
		 {
                                    canvas   : <canvas>,
                                    bounds   : <bounds in WGS84>
                                    size     : <view size>,
                                    zoomScale: <zoom scale is  1/resolution>,
                                    zoom     : <current zoom>,
                                    options  : <options passed >
                 };

Other useful full view  Leaflet Canvas sources here:
- [leaflet.heat](https://github.com/Leaflet/Leaflet.heat)
- [Full Canvas] (https://github.com/cyrilcherian/Leaflet-Fullcanvas)
- [CartoDb Leaflet.Canvas] (https://github.com/CartoDB/Leaflet.CanvasLayer)

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