@daturon/mapboxgl-layer-manager
v1.1.1
Published
The Layer Manager for Mapbox GL is a versatile and user-friendly tool designed to streamline the management of map layers within the Mapbox GL environment. This tool simplifies the process of modifying layer order and adjusting and fine-tuning each layer'
Downloads
436
Readme
The Layer Manager for Mapbox GL is a versatile and user-friendly tool designed to streamline the management of map layers within the Mapbox GL environment. This tool simplifies the process of modifying layer order and adjusting and fine-tuning each layer's settings on a map.
Key Features:
Layer Ordering: One of the primary functions of the Layer Manager is to enable users to change the ordering of map layers easily. Whether you need to bring a specific layer to the foreground or send it to the background, this intuitive feature ensures that users can organize layers to meet their mapping needs by providing a new list of layer ordering.
Settings Management: The Layer Manager is a comprehensive solution for handling all aspects of layer settings. Users can access and modify a wide range of properties for each layer, such as layout, paint options, and more.
Quick start
import { useLayerManager } from '@daturon/mapboxgl-layer-manager';
const layerManager = useLayerManager(map.current, sources, layers);
layerManager.renderOrderedLayers([
'layer-id-1',
'layer-id-2',
],
{ "layer-id-2": { paint: { "fill-color": "green" } } });
Install
npm:
npm install @daturon/mapboxgl-layer-manager
yarn:
yarn add @daturon/mapboxgl-layer-manager