{"_id":"@mapbox/mapbox-gl-traffic","_rev":"226-835f9a5d39ad8e860ad81f65fe5d42f7","name":"@mapbox/mapbox-gl-traffic","description":"Mapbox GL JS plugin for enabling/disabling traffic","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.2":{"name":"@mapbox/mapbox-gl-traffic","version":"1.0.2","description":"Mapbox GL JS plugin for enabling/disabling traffic","main":"mapbox-gl-traffic.js","scripts":{"test":"eslint *.js","docs":"documentation readme index.js --section API"},"repository":{"type":"git","url":"git+https://github.com/mapbox/mapbox-gl-traffic.git"},"keywords":["mapbox","gis","vector","leaflet","gl"],"author":{"name":"Lukas Martinelli"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/mapbox/mapbox-gl-traffic/issues"},"homepage":"https://github.com/mapbox/mapbox-gl-traffic#readme","devDependencies":{"browserify":"^11.2.0","documentation":"^4.0.0-beta.18","eslint":"^2.8.0","eslint-config-mourner":"^2.0.1","uglify-js":"^2.4.24","watchify":"^3.8.0"},"peerDependencies":{"mapbox-gl":"^0.29.0"},"eslintConfig":{"parserOptions":{"sourceType":"module"},"env":{"browser":true},"extends":"mourner","rules":{"indent":[2,2]}},"gitHead":"7b9c88e91813a0456f18b0d70dadc1cd9ae52507","_id":"@mapbox/mapbox-gl-traffic@1.0.2","_shasum":"afb120633a397a6c539865db2bde5c5933dad96b","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.0","_npmUser":{"name":"lukasmartinelli","email":"me@lukasmartinelli.ch"},"dist":{"shasum":"afb120633a397a6c539865db2bde5c5933dad96b","tarball":"https://registry.npmjs.org/@mapbox/mapbox-gl-traffic/-/mapbox-gl-traffic-1.0.2.tgz","integrity":"sha512-HeUljK/CibQIL/srbErxKNZYWie4N2F377AEvDyXeAP1qyYTP5VNklTaQ/wZjOyZ/qbPN2kStjwQR3UUP+AG7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2S2ebEMdCAssm+kebwx/YpLRJZ3EzKAskOoNhAXL1RgIhAPq6dczpfMB/hsxqUMVQeX4vwyaeUvo0S+g+jOAY7DOz"}]},"maintainers":[{"name":"lukasmartinelli","email":"me@lukasmartinelli.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mapbox-gl-traffic-1.0.2.tgz_1495230104636_0.675826464779675"},"directories":{}}},"readme":"# Mapbox GL Traffic [![Build Status](https://travis-ci.org/mapbox/mapbox-gl-traffic.svg?branch=master)](https://travis-ci.org/mapbox/mapbox-gl-traffic) [![npm](https://img.shields.io/npm/v/mapbox-gl-traffic.svg)](https://www.npmjs.com/package/mapbox-gl-traffic)\n\nAdd a traffic toggle control to [Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js).\n\n[**:globe_with_meridians: Check the demo**](https://mapbox.github.io/mapbox-gl-traffic/)\n\n![demo](https://raw.githubusercontent.com/lukasmartinelli/mapbox-gl-traffic/master/demo.gif)\n\n## Usage\n\n**mapbox-gl-traffic** is a [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that you can easily add on top of your map. Check `index.html` for a complete example.\n\nMake sure to include the CSS and JS files.\n\n**When using NPM**\n\nCheck [how to use Mapbox GL JS in a module bundler](https://www.mapbox.com/mapbox-gl-js/api/).\n\n```bash\nnpm install --save mapbox-gl @mapbox/mapbox-gl-traffic\n```\n\n```javascript\nconst mapboxgl = require('mapbox-gl')\nconst MapboxTraffic = require('@mapbox/mapbox-gl-traffic');\nconst map = new mapboxgl.Map({\n    container: 'map',\n    style: 'mapbox://styles/mapbox/traffic-night-v2',\n    center: [-77.0259, 38.9010],\n    zoom: 9\n});\nmap.addControl(new MapboxTraffic());\n```\n\n## Examples\n\n- [Mapbox Day Traffic](https://mapbox.github.io/mapbox-gl-traffic/examples/traffic-day.html)\n- [Mapbox Night Traffic](https://mapbox.github.io/mapbox-gl-traffic/examples/traffic-night.html)\n- [Mapbox Streets](https://mapbox.github.io/mapbox-gl-traffic/examples/mapbox-streets.html)\n- [Mapbox Outdoors](https://mapbox.github.io/mapbox-gl-traffic/examples/mapbox-outdoors.html)\n- [Mapbox Light](https://mapbox.github.io/mapbox-gl-traffic/examples/mapbox-light.html)\n- [Mapbox Dark](https://mapbox.github.io/mapbox-gl-traffic/examples/mapbox-dark.html)\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n### MapboxTraffic\n\nCreate a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that allows you to hide and show\ntraffic layers in your map and an optional toggle button.\n\n**Parameters**\n\n-   `options` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options to configure the plugin.\n    -   `options.showTraffic` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Show or hide traffic overlay by default. (optional, default `false`)\n    -   `options.showTrafficButton` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Show a toggle button to turn traffic on and off. (optional, default `true`)\n    -   `options.trafficSource` **[RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)** The traffic source regex used to determine whether a layer displays traffic or not. (optional, default `/mapbox-traffic-v\\d/`)\n\n## Develop\n\nRun the linter and watch for changes to rebuild with browserify.\n\n    npm install\n    npm run test\n    npm run watch\n\nCreate a minified standalone build.\n\n    npm install\n    npm run build\n","maintainers":[{"email":"yannick.meeus+npm+production+ci@mapbox.com","name":"mbx-npm-ci-production"},{"email":"yannick.meeus+npm+staging+ci@mapbox.com","name":"mbx-npm-ci-staging"},{"email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com","name":"mbx-npm-advanced-actions-production"},{"email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com","name":"mbx-npm-advanced-actions-staging"},{"email":"yannick.meeus+npm+prod+09@mapbox.com","name":"mbx-npm-09-production"},{"email":"yannick.meeus+npm+prod+08@mapbox.com","name":"mbx-npm-08-production"},{"email":"yannick.meeus+npm+prod+07@mapbox.com","name":"mbx-npm-07-production"},{"email":"yannick.meeus+npm+prod+06@mapbox.com","name":"mbx-npm-06-production"},{"email":"yannick.meeus+npm+prod+05@mapbox.com","name":"mbx-npm-05-production"},{"email":"yannick.meeus+npm+prod+04@mapbox.com","name":"mbx-npm-04-production"},{"email":"yannick.meeus+npm+prod+03@mapbox.com","name":"mbx-npm-03-production"},{"email":"yannick.meeus+npm+prod+02@mapbox.com","name":"mbx-npm-02-production"},{"email":"yannick.meeus+npm+prod+01@mapbox.com","name":"mbx-npm-01-production"},{"email":"yannick.meeus@mapbox.com","name":"mbx-npm-02-staging"},{"email":"accounts+npmjs-01@mapbox.com","name":"mapbox-npm-01"},{"email":"accounts+npmjs-02@mapbox.com","name":"mapbox-npm-02"},{"email":"accounts+npmjs-07@mapbox.com","name":"mapbox-npm-07"},{"email":"accounts+npmjs-03@mapbox.com","name":"mapbox-npm-03"},{"email":"accounts+npmjs-04@mapbox.com","name":"mapbox-npm-04"},{"email":"accounts+npmjs-09@mapbox.com","name":"mapbox-npm-09"},{"email":"accounts+npmjs-05@mapbox.com","name":"mapbox-npm-05"},{"email":"accounts+npmjs-06@mapbox.com","name":"mapbox-npm-06"},{"email":"accounts+npmjs-08@mapbox.com","name":"mapbox-npm-08"},{"email":"accounts+npmjs-advanced-actions@mapbox.com","name":"mapbox-npm-advanced-actions"},{"email":"accounts+npmjs-npm-ci@mapbox.com","name":"mapbox-npm-ci"},{"email":"accounts+npmjs@mapbox.com","name":"mapbox-npm"},{"email":"accounts@mapbox.com","name":"mapbox-admin"},{"email":"accounts+npm-mapbox-machine-user@mapbox.com","name":"mapbox-machine-user"}],"time":{"modified":"2023-01-12T12:43:33.832Z","created":"2017-05-19T21:41:45.854Z","1.0.2":"2017-05-19T21:41:45.854Z"},"homepage":"https://github.com/mapbox/mapbox-gl-traffic#readme","keywords":["mapbox","gis","vector","leaflet","gl"],"repository":{"type":"git","url":"git+https://github.com/mapbox/mapbox-gl-traffic.git"},"author":{"name":"Lukas Martinelli"},"bugs":{"url":"https://github.com/mapbox/mapbox-gl-traffic/issues"},"license":"BSD-3-Clause","readmeFilename":"README.md"}