JSPM

mapbox-gl-layer-switcher

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q24974F
  • License MIT

Turn layers on/off in mapbox-gl with transition effect.

Package Exports

  • mapbox-gl-layer-switcher

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mapbox-gl-layer-switcher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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