ol-layerlist
Version:
Layer switcher control for OpenLayers v3/v4/v5
26 lines (15 loc) • 667 B
Markdown
Based on [OpenLayers 3 Browserify Tutorial](https://openlayers.org/en/latest/doc/tutorials/browserify.html).
For a one-time build run:
npm run build
If you want to make changes and have the project auto build run:
npm run start
// Pass the path to `ol3-layerswitcher.js` minus the extension to `require`
// which will return the constructor
var LayerSwitcher = require('../../src/ol3-layerswitcher');
// Create an instance
var layerSwitcher = new LayerSwitcher();
// Add to a `ol.Map` instance as normal
map.addControl(layerSwitcher);