code: function MapboxTraffic(options) {
    if (!(this instanceof MapboxTraffic)) {
      throw new Error('MapboxTraffic needs to be called with the new keyword');
    }
  
    this.options = Object.assign({
      showTraffic: false,
      showTrafficButton: true,
      trafficSource: /mapbox-traffic-v\d/
    }, options);
  
    this.render = this.render.bind(this);
    this.toggleTraffic = this.toggleTraffic.bind(this);
    this._hideTraffic = this._hideTraffic.bind(this);
    this._showTraffic = this._showTraffic.bind(this);
    this._hasTraffic = this._hasTraffic.bind(this);
    this._toggle = new TrafficButton({
      show: this.options.showTrafficButton,
      onToggle: this.toggleTraffic.bind(this)
    });
  }
docs: Create a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that allows you to hide and show
  traffic layers in your map and an optional toggle button.
  @constructor
  @param {object} options - Options to configure the plugin.
  @param {boolean} [options.showTraffic=false] - Show or hide traffic overlay by default.
  @param {boolean} [options.showTrafficButton=true] - Show a toggle button to turn traffic on and off.
  @param {RegExp} [options.trafficSource=/mapbox-traffic-v\d/] - The traffic source regex used to determine whether a layer displays traffic or not.