# leaflet-webgl-overlay

> WebGL marker rendering for leaflet

Latest version **1.0.10** (published 2020-01-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install leaflet-webgl-overlay
pnpm add leaflet-webgl-overlay
yarn add leaflet-webgl-overlay
bun add leaflet-webgl-overlay
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2020-01-09 |
| First published | 2019-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 83.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | OMTLAB Ltd. |
| Maintainers | bgorzsony |

## Links

- npm: https://www.npmjs.com/package/leaflet-webgl-overlay
- npm.io page: https://npm.io/package/leaflet-webgl-overlay

## Dependencies (2)

- [leaflet](https://npm.io/package/leaflet.md) ^1.5.1
- [gl-matrix](https://npm.io/package/gl-matrix.md) ^3.1.0

## Recent versions

- 1.0.10 (latest) — 2020-01-09
- 1.0.9 — 2020-01-09
- 1.0.8 — 2019-12-17
- 1.0.7 — 2019-12-17
- 1.0.6 — 2019-12-17
- 1.0.5 — 2019-09-24
- 1.0.4 — 2019-09-23
- 1.0.3 — 2019-09-23
- 1.0.2 — 2019-09-11
- 1.0.1 — 2019-09-11
- 1.0.0 — 2019-09-09

## README

# WebGL overlay for leaflet
Using [leafletjs-canvas-overlay](https://github.com/danwild/leafletjs-canvas-overlay) for canvas. Based on [this](http://bl.ocks.org/Sumbera/c6fed35c377a46ff74c3) blog post.

## Building

Install the dependencies by running `npm install` then build project by running `npm run build`. The built files will be place in the `./dist` directory.

## Installing
Install the package by running `npm install leaflet-webgl-overlay`

[npm package](https://www.npmjs.com/package/leaflet-webgl-overlay)


## Basic usage

Create a new WebGLOverlay and add it to your leaflet map:
```js
let overlay = new WebGLOverlay();
overlay.addTo(map);
```

You can add GLMarkers and GLCircleMarkers to this overlay.
```js
overlay.addMarker(new GLMarker([0,0],options));
overlay.addCircleMarker(new GLCircleMarker([10,10],options));
```

A popup can be binded to the markers, that opens when the marker is clicked.
```js
let marker = new GLMarker([0,0],options);
marker.bindPopup('content',options);
```


#### GLMarkerOptions:
```js
export interface GLMarkerOptions{
    color?: string; // color in hex format
    opacity?: number; // opacity value between 0-1
    popupPos?: number[]; // position of the popup relative to the icon's anchor position
    rotation?: number; // marker rotation in radian
    icon?: GLIconOptions; // icon of the marker
}
```
#### GLIconOptions
```js
export interface GLIconOptions {
    url: string; // path to the icon img
    size: number[]; // size of the icon [width,height]
    anchorPos: number[]; //icon anchor position relative to the top-left corner of the image [x,y]
}
```


#### GLCircleMarkerOptions:
```js
export interface GLCircleMarkerOptions {
     color?: string; // color in hex format
    opacity?: number; // opacity value between 0-1
    popupPos?: number[]; // position of the popup relative to the icon's anchor position
    radius?: number; // size of the marker
}
```

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