Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/beilinson/mapbox-layer-groups
- Owner: Beilinson
- License: mit
- Created: 2023-04-26T17:23:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-14T19:19:17.000Z (over 1 year ago)
- Last Synced: 2024-11-07T22:44:42.639Z (about 2 months ago)
- Language: TypeScript
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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,
...
}))
```