Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/beilinson/mapbox-layer-groups

A library for managing groups of layers in mapbox
https://github.com/beilinson/mapbox-layer-groups

Last synced: about 1 month ago
JSON representation

A library for managing groups of layers in mapbox

Awesome Lists containing this project

README

        

# mapbox-layer-groups
A library for managing groups of layers in mapbox. Based on https://github.com/mapbox/mapbox-gl-layer-groups.

Extends the Map API with the following methods:

```typescript
map.addLayerGroup(id, [layers])
map.addLayerToGroup(id, layer)
map.removeLayerGroup(id)
map.getLayerGroup(id)
```

Additionally, adds a built-in layer group for geoJson (a circle layer for non-clustered points, a fill and line layer for polygons, and a line layer for linestrings).

```typescript
map.addSource(id, { type: 'geojson', ... })
map.addLayerGroup(id, createGeoJsonGroup({
id: 'layer'
source: id,
...
}))
```