{"_id":"@mapbox/vector-tile","_rev":"402770","name":"@mapbox/vector-tile","description":"Parses vector tiles","dist-tags":{"latest":"1.3.1"},"maintainers":[{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"}],"time":{"modified":"2021-08-04T04:37:12.000Z","created":"2016-08-11T15:56:51.171Z","1.3.1":"2018-03-03T00:43:28.251Z","1.3.0":"2017-04-21T20:31:23.134Z","1.0.0-alpha.1":"2016-08-26T22:09:46.401Z","1.0.0-rc3":"2016-08-22T04:21:44.043Z","1.0.0-rc2":"2016-08-12T14:29:41.771Z","1.0.0-rc1":"2016-08-11T15:56:51.171Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/mapbox/vector-tile-js.git"},"versions":{"1.3.1":{"name":"@mapbox/vector-tile","description":"Parses vector tiles","repository":{"type":"git","url":"git+https://github.com/mapbox/vector-tile-js.git"},"version":"1.3.1","license":"BSD-3-Clause","main":"index.js","dependencies":{"@mapbox/point-geometry":"~0.1.0"},"devDependencies":{"benchmark":"^1.0.0","coveralls":"~2.11.2","istanbul":"~0.3.6","mapnik":"~3.6.0","jshint":"^2.6.3","pbf":"^1.3.2","tape":"~3.5.0","eslint":"~1.00.0","eslint-config-unstyled":"^1.1.0"},"jshintConfig":{"trailing":true,"undef":true,"unused":true,"indent":4,"node":true},"scripts":{"test":"eslint lib index.js && jshint lib && tape test/parse.test.js","cov":"istanbul cover ./node_modules/.bin/tape test/parse.test.js && coveralls < ./coverage/lcov.info"},"gitHead":"58df1e9344ee64f26deee84a9f54cee11fb95ef6","bugs":{"url":"https://github.com/mapbox/vector-tile-js/issues"},"homepage":"https://github.com/mapbox/vector-tile-js#readme","_id":"@mapbox/vector-tile@1.3.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"anandthakker","email":"vestibule@anandthakker.net"},"dist":{"shasum":"d3a74c90402d06e89ec66de49ec817ff53409666","size":123386,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-1.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@mapbox/vector-tile/download/@mapbox/vector-tile-1.3.1.tgz"},"maintainers":[{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vector-tile_1.3.1_1520037808133_0.32587944848863715"},"_hasShrinkwrap":false,"publish_time":1520037808251,"_cnpm_publish_time":1520037808251},"1.3.0":{"name":"@mapbox/vector-tile","description":"Parses vector tiles","repository":{"type":"git","url":"git+https://github.com/mapbox/vector-tile-js.git"},"version":"1.3.0","license":"BSD-3-Clause","main":"index.js","dependencies":{"@mapbox/point-geometry":"~0.1.0"},"devDependencies":{"benchmark":"^1.0.0","coveralls":"~2.11.2","istanbul":"~0.3.6","mapnik":"^3.6.0","jshint":"^2.6.3","pbf":"^1.3.2","tape":"~3.5.0","eslint":"~1.00.0","eslint-config-unstyled":"^1.1.0"},"jshintConfig":{"trailing":true,"undef":true,"unused":true,"indent":4,"node":true},"scripts":{"test":"eslint lib index.js && jshint lib && tape test/parse.test.js","cov":"istanbul cover ./node_modules/.bin/tape test/parse.test.js && coveralls < ./coverage/lcov.info"},"gitHead":"e49aff8a973e7c98fe287cb15e3d3bd15c7b31b0","bugs":{"url":"https://github.com/mapbox/vector-tile-js/issues"},"homepage":"https://github.com/mapbox/vector-tile-js#readme","_id":"@mapbox/vector-tile@1.3.0","_shasum":"c495f972525befccefcd838f45ffa37ef3b70fe8","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.2","_npmUser":{"name":"flippmoke","email":"flippmoke@gmail.com"},"dist":{"shasum":"c495f972525befccefcd838f45ffa37ef3b70fe8","size":122908,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@mapbox/vector-tile/download/@mapbox/vector-tile-1.3.0.tgz"},"maintainers":[{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vector-tile-1.3.0.tgz_1492806682349_0.3445038564968854"},"directories":{},"publish_time":1492806683134,"_hasShrinkwrap":false,"_cnpm_publish_time":1492806683134},"1.0.0-alpha.1":{"name":"@mapbox/vector-tile","version":"1.0.0-alpha.1","description":"A C++ header only library for decoding and encoding Mapbox Vector Tiles","main":"./include_dirs.js","repository":{"type":"git","url":"git://github.com/mapbox/vector-tile.git"},"gitHead":"9352352d7f9cd55958232ac55dc1f86a5d9a1192","bugs":{"url":"https://github.com/mapbox/vector-tile/issues"},"homepage":"https://github.com/mapbox/vector-tile#readme","_id":"@mapbox/vector-tile@1.0.0-alpha.1","scripts":{},"_shasum":"923eb8c63d6adef7862dab39b7dbe443bf46c271","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"springmeyer","email":"dane@mapbox.com"},"dist":{"shasum":"923eb8c63d6adef7862dab39b7dbe443bf46c271","size":5053,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-1.0.0-alpha.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@mapbox/vector-tile/download/@mapbox/vector-tile-1.0.0-alpha.1.tgz"},"maintainers":[{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vector-tile-1.0.0-alpha.1.tgz_1472249386171_0.18954596132971346"},"directories":{},"publish_time":1472249386401,"_cnpm_publish_time":1472249386401,"_hasShrinkwrap":false},"1.0.0-rc3":{"name":"@mapbox/vector-tile","version":"1.0.0-rc3","description":"A C++ header only library for decoding and encoding Mapbox Vector Tiles","main":"./include_dirs.js","repository":{"type":"git","url":"git://github.com/mapbox/vector-tile.git"},"gitHead":"6c0acee457edd3ac05612954fba6b08095366d2e","bugs":{"url":"https://github.com/mapbox/vector-tile/issues"},"homepage":"https://github.com/mapbox/vector-tile#readme","_id":"@mapbox/vector-tile@1.0.0-rc3","scripts":{},"_shasum":"b000cf383cb2492607f5b3c5ed09facddda3af0d","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"springmeyer","email":"dane@mapbox.com"},"dist":{"shasum":"b000cf383cb2492607f5b3c5ed09facddda3af0d","size":1639,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-1.0.0-rc3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@mapbox/vector-tile/download/@mapbox/vector-tile-1.0.0-rc3.tgz"},"maintainers":[{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vector-tile-1.0.0-rc3.tgz_1471839703783_0.8554384266026318"},"directories":{},"publish_time":1471839704043,"_cnpm_publish_time":1471839704043,"_hasShrinkwrap":false},"1.0.0-rc2":{"name":"@mapbox/vector-tile","version":"1.0.0-rc2","description":"A C++ header only library for decoding and encoding Mapbox Vector Tiles","main":"./package.json","repository":{"type":"git","url":"git://github.com/mapbox/vector-tile.git"},"gitHead":"c91d56ae777283c6fda02b35b70239eee783af70","bugs":{"url":"https://github.com/mapbox/vector-tile/issues"},"homepage":"https://github.com/mapbox/vector-tile#readme","_id":"@mapbox/vector-tile@1.0.0-rc2","scripts":{},"_shasum":"6f23104368973b58aff5d1adc90585af2754f194","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"mapsam","email":"sam@mapbox.com"},"dist":{"shasum":"6f23104368973b58aff5d1adc90585af2754f194","size":72477,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-1.0.0-rc2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@mapbox/vector-tile/download/@mapbox/vector-tile-1.0.0-rc2.tgz"},"maintainers":[{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vector-tile-1.0.0-rc2.tgz_1471012179792_0.040663618594408035"},"directories":{},"publish_time":1471012181771,"_cnpm_publish_time":1471012181771,"_hasShrinkwrap":false},"1.0.0-rc1":{"name":"@mapbox/vector-tile","version":"1.0.0-rc1","description":"A C++ header only library for decoding and encoding Mapbox Vector Tiles","main":"./package.json","repository":{"type":"git","url":"git://github.com/mapbox/vector-tile.git"},"gitHead":"a4b2b907b6c1aa29592918f6fd879051786ecf7c","bugs":{"url":"https://github.com/mapbox/vector-tile/issues"},"homepage":"https://github.com/mapbox/vector-tile#readme","_id":"@mapbox/vector-tile@1.0.0-rc1","scripts":{},"_shasum":"94455614982739e03b3577f742941121e13d06a3","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"mapsam","email":"sam@mapbox.com"},"dist":{"shasum":"94455614982739e03b3577f742941121e13d06a3","size":72325,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-1.0.0-rc1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@mapbox/vector-tile/download/@mapbox/vector-tile-1.0.0-rc1.tgz"},"maintainers":[{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/vector-tile-1.0.0-rc1.tgz_1470931009983_0.8698394750244915"},"directories":{},"publish_time":1470931011171,"_cnpm_publish_time":1470931011171,"_hasShrinkwrap":false}},"readme":"# vector-tile\n\n[![build status](https://secure.travis-ci.org/mapbox/vector-tile-js.svg)](http://travis-ci.org/mapbox/vector-tile-js) [![Coverage Status](https://coveralls.io/repos/mapbox/vector-tile-js/badge.svg)](https://coveralls.io/r/mapbox/vector-tile-js)\n\nThis library reads [Mapbox Vector Tiles](https://github.com/mapbox/vector-tile-spec) and allows access to the layers and features.\n\n## Example\n\n```js\nvar VectorTile = require('@mapbox/vector-tile').VectorTile;\nvar Protobuf = require('pbf');\n\nvar tile = new VectorTile(new Protobuf(data));\n\n// Contains a map of all layers\ntile.layers;\n\nvar landuse = tile.layers.landuse;\n\n// Amount of features in this layer\nlanduse.length;\n\n// Returns the first feature\nlanduse.feature(0);\n```\n\nVector tiles contained in [serialtiles-spec](https://github.com/mapbox/serialtiles-spec)\nare gzip-encoded, so a complete example of parsing them with the native\nzlib module would be:\n\n```js\nvar VectorTile = require('vector-tile').VectorTile;\nvar Protobuf = require('pbf');\nvar zlib = require('zlib');\n\nzlib.gunzip(data, function(err, buffer) {\n    var tile = new VectorTile(new Protobuf(buffer));\n});\n```\n\n## Depends\n\n - Node.js v0.10.x or v0.8.x\n\n\n## Install\n\nTo install:\n\n    npm install @mapbox/vector-tile\n\n\n## API Reference\n\n\n### VectorTile\n\nAn object that parses vector tile data and makes it readable.\n\n#### Constructor\n\n- **new VectorTile(protobuf[, end])** &mdash;\n  parses the vector tile data contained in the given [Protobuf](https://github.com/mapbox/pbf) object,\n  saving resulting layers in the created object as a `layers` property. Optionally accepts end index.\n\n#### Properties\n\n- **layers** (Object) &mdash; an object containing parsed layers in the form of `{<name>: <layer>, ...}`,\nwhere each layer is a `VectorTileLayer` object.\n\n\n### VectorTileLayer\n\nAn object that contains the data for a single vector tile layer.\n\n#### Properties\n\n- **version** (`Number`, default: `1`)\n- **name** (`String) `&mdash; layer name\n- **extent** (`Number`, default: `4096`) &mdash; tile extent size\n- **length** (`Number`) &mdash; number of features in the layer\n\n#### Methods\n\n- **feature(i)** &mdash; get a feature (`VectorTileFeature`) by the given index from the layer.\n\n\n### VectorTileFeature\n\nAn object that contains the data for a single feature.\n\n#### Properties\n\n- **type** (`Number`) &mdash; type of the feature (also see `VectorTileFeature.types`)\n- **extent** (`Number`) &mdash; feature extent size\n- **id** (`Number`) &mdash; feature identifier, if present\n- **properties** (`Object`) &mdash; object literal with feature properties\n\n#### Methods\n\n- **loadGeometry()** &mdash; parses feature geometry and returns an array of\n  [Point](https://github.com/mapbox/point-geometry) arrays (with each point having `x` and `y` properties)\n- **bbox()** &mdash; calculates and returns the bounding box of the feature in the form `[x1, y1, x2, y2]`\n- **toGeoJSON(x, y, z)** &mdash; returns a GeoJSON representation of the feature. (`x`, `y`, and `z` refer to the containing tile's index.)\n","_attachments":{},"homepage":"https://github.com/mapbox/vector-tile-js#readme","bugs":{"url":"https://github.com/mapbox/vector-tile-js/issues"},"license":"BSD-3-Clause"}