mapbox-gl-layer-switcher

1.0.1 • Public • Published

mapbox-gl-layer-switcher

mapbox-gl-layer-switcher is a plugin for MapBox GL JS which allows to turn layers on/off with a smooth transition effect.

Usage

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 added
  • map - instance of mapboxgl.Map
  • 400 - is a transition duration in ms

Package Sidebar

Install

npm i mapbox-gl-layer-switcher

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

5.67 kB

Total Files

4

Last publish

Collaborators

  • malexer