Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 627 Bytes

README.md

File metadata and controls

22 lines (18 loc) · 627 Bytes

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:

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).

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