Turn layers on/off in mapbox-gl with transition effect.
npm install mapbox-gl-layer-switchermapbox-gl-layer-switcher is a plugin for MapBox GL JS which allows to
turn layers on/off with a smooth transition effect.
``js
import LayerSwitcher from 'mapbox-gl-layer-switcher';
var switcher = new LayerSwitcher(layerId, map, 400);
switcher.show(); // to show layer
switcher.hide(); // to hide layer
`
where:
* layerId - id of the layer which was already addedmap
* - instance of mapboxgl.Map400` - is a transition duration in ms
*