{"name":"@mapbox/vector-tile","version":"2.0.4","license":"BSD-3-Clause","_id":"@mapbox/vector-tile@2.0.4","maintainers":[{"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"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"}],"homepage":"https://github.com/mapbox/vector-tile-js#readme","bugs":{"url":"https://github.com/mapbox/vector-tile-js/issues"},"dist":{"shasum":"59c5ca80a84c210e61226367b0f9c8fd1737a437","tarball":"http://registry-npm.ywwl.com/@mapbox/vector-tile/download/@mapbox/vector-tile-2.0.4.tgz","fileCount":5,"integrity":"sha512-AkOLcbgGTdXScosBWwmmD7cDlvOjkg/DetGva26pIRiZPdeJYjYKarIlb4uxVzi6bwHO6EWH82eZ5Nuv4T5DUg==","signatures":[{"sig":"MEQCIHpUcormOc0y79x/2FtEiHm0cRe+/ymcW4rBGKE0KqAZAiAh9ycDR63TevUw5BQYhRZOeg0zO9V3Vjny7S6tVIIfPg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17628,"size":5067,"noattachment":false,"key":"/@mapbox/vector-tile/-/@mapbox/vector-tile-2.0.4.tgz"},"main":"index.js","type":"module","types":"index.d.ts","exports":"./index.js","gitHead":"f1457ee47d0a261e6246d68c959fbd12bf56aeeb","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":"mbx-npm-05-production","actor":{"name":"mbx-npm-05-production","type":"user","email":"yannick.meeus+npm+prod+05@mapbox.com"},"email":"yannick.meeus+npm+prod+05@mapbox.com"},"repository":{"url":"git+https://github.com/mapbox/vector-tile-js.git"},"_npmVersion":"11.3.0","description":"Parses vector tiles","directories":{},"_nodeVersion":"20.15.1","dependencies":{"pbf":"^4.0.1","@types/geojson":"^7946.0.16","@mapbox/point-geometry":"~1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.29.0","benchmark":"^2.1.4","typescript":"^5.8.3","eslint-config-mourner":"^4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/vector-tile_2.0.4_1750234291332_0.7281928850274706","host":"s3://npm-registry-packages-npm-production"},"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":1750234291496,"_cnpm_publish_time":1750234291496,"dist-tags":{"latest":"3.0.0"}}