{"name":"@mapbox/vector-tile","version":"2.0.0","license":"BSD-3-Clause","_id":"@mapbox/vector-tile@2.0.0","maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@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-07","email":"accounts+npmjs-07@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-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"homepage":"https://github.com/mapbox/vector-tile-js#readme","bugs":{"url":"https://github.com/mapbox/vector-tile-js/issues"},"dist":{"shasum":"8028fa2cd91d38edffb2ee44ab63ec4be0d717f5","tarball":"http://registry-npm.ywwl.com/@mapbox/vector-tile/download/@mapbox/vector-tile-2.0.0.tgz","fileCount":5,"integrity":"sha512-KuYAq3RNv2ZQc75+vvurIPQw/6a++myg0j69RR8Q4NVNziPrgHGcsD1AlzzflIoGk1H4DJQnmfyV+ar+TYOZ7g==","signatures":[{"sig":"MEQCIAQ6HgIL32pgFLNMw1rej9OZnaZR26n0UlTK2rkRN7AHAiA3/d4R/tAln9QcNgYKMys3PFHOsMFaat31gz7IvpdBbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16453,"size":4935,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-2.0.0.tgz"},"main":"index.js","type":"module","types":"index.d.ts","exports":"./index.js","gitHead":"b1146ad9924e246229e5566fabe95bad9284bb16","scripts":{"cov":"node --test --experimental-test-coverage","lint":"eslint index.js test/*.js","test":"tsc && node --test","pretest":"npm run lint","prepublishOnly":"npm test"},"_npmUser":{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},"repository":{"url":"git+https://github.com/mapbox/vector-tile-js.git"},"_npmVersion":"10.5.1","description":"Parses vector tiles","directories":{},"_nodeVersion":"20.12.1","dependencies":{"pbf":"^4.0.1","@types/geojson":"^7946.0.14","@mapbox/point-geometry":"~1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.6.0","benchmark":"^2.1.4","typescript":"^5.5.3","eslint-config-mourner":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/vector-tile_2.0.0_1720690562937_0.0677394496476249","host":"s3://npm-registry-packages"},"readme":"# vector-tile\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\nimport {VectorTile} from '@mapbox/vector-tile';\nimport Protobuf from 'pbf';\n\nconst tile = new VectorTile(new Protobuf(data));\n\n// Contains a map of all layers\ntile.layers;\n\nconst 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\nimport {VectorTile} from '@mapbox/vector-tile';\nimport Protobuf from 'pbf';\nimport {gunzipSync} from 'zlib';\n\nconst buffer = gunzipSync(data);\nconst tile = new VectorTile(new Protobuf(buffer));\n```\n\n## Install\n\nTo install:\n\n    npm install @mapbox/vector-tile\n\n\n## API Reference\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","publish_time":1720690563092,"_cnpm_publish_time":1720690563092,"dist-tags":{"latest":"3.0.0"}}