{"name":"vector-tile","description":"Parses vector tiles","repository":{"type":"git","url":"https://github.com/mapbox/vector-tile-js.git"},"version":"1.1.0","license":"BSD","main":"index.js","dependencies":{"point-geometry":"0.0.0","sphericalmercator":"^1.0.3"},"devDependencies":{"benchmark":"^1.0.0","coveralls":"~2.10.0","istanbul":"~0.2.11","jshint":"^2.5.1","pbf":"^1.1.3","tape":"~2.13.3"},"jshintConfig":{"trailing":true,"undef":true,"unused":true,"indent":4,"node":true},"scripts":{"test":"jshint lib && tape test/parse.test.js","cov":"istanbul cover ./node_modules/.bin/tape test/parse.test.js && coveralls < ./coverage/lcov.info"},"gitHead":"8b44523394fc581b3a1129db23e593e5bf299d94","bugs":{"url":"https://github.com/mapbox/vector-tile-js/issues"},"homepage":"https://github.com/mapbox/vector-tile-js","_id":"vector-tile@1.1.0","_shasum":"de077c2b56cc9bdbc809e9c9e737d66c919bba05","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"jfirebaugh","email":"john.firebaugh@gmail.com"},"maintainers":[{"name":"springmeyer","email":"dane@mapbox.com"},{"name":"kkaefer","email":"kkaefer@gmail.com"},{"name":"mourner","email":"agafonkin@gmail.com"},{"name":"tmcw","email":"tom@macwright.org"},{"name":"edenh","email":"eden@mapbox.com"},{"name":"ansis","email":"ansis.brammanis@gmail.com"},{"name":"karenzshea","email":"karen@mapbox.com"},{"name":"sgillies","email":"sean@mapbox.com"},{"name":"lbud","email":"lauren@mapbox.com"},{"name":"bsudekum","email":"bobby@mapbox.com"},{"name":"dnomadb","email":"damon@mapbox.com"},{"name":"ian29","email":"ian.villeda@gmail.com"},{"name":"dvncan","email":"duncan@mapbox.com"},{"name":"nickidlugash","email":"nicki@mapbox.com"},{"name":"samanbb","email":"saman@mapbox.com"},{"name":"ajashton","email":"aj.ashton@gmail.com"},{"name":"lxbarth","email":"alex@developmentseed.org"},{"name":"mikemorris","email":"michael.patrick.morris@gmail.com"},{"name":"ianshward","email":"ian@mapbox.com"},{"name":"tristen","email":"tristen.brown@gmail.com"},{"name":"ingalls","email":"nicholas.ingalls@gmail.com"},{"name":"jfirebaugh","email":"john.firebaugh@gmail.com"},{"name":"miccolis","email":"jeff@miccolis.net"},{"name":"gretacb","email":"carol@mapbox.com"},{"name":"aaronlidman","email":"aaronlidman@gmail.com"},{"name":"morganherlocker","email":"morgan.herlocker@gmail.com"},{"name":"camilleanne","email":"camille@mapbox.com"},{"name":"rclark","email":"ryan.clark.j@gmail.com"},{"name":"mapbox","email":"accounts@mapbox.com"},{"name":"willwhite","email":"will@mapbox.com"},{"name":"dthompson","email":"dthompson@gmail.com"}],"dist":{"shasum":"de077c2b56cc9bdbc809e9c9e737d66c919bba05","tarball":"http://registry-npm.ywwl.com/vector-tile/download/vector-tile-1.1.0.tgz","integrity":"sha512-Q6plj0tUqK0JjzvQDuv8MRI3CE00wNVfQVnNdCDE34S47srni21P5dLFi8JtrL0Oc3hpgzd1Llip8x3/kve+VQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFwQTh1Bdoiav7IBqnfwqwBu5AhoyuW3BsAxGYx+r10wAiAUo4dUcBaDgaGhM/88KMG8nrkgee/bPH8ScgBE5HrOWA=="}],"size":118040,"noattachment":false,"key":"/vector-tile/-/vector-tile-1.1.0.tgz"},"deprecated":"This module has moved: please install @mapbox/vector-tile instead","directories":{},"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('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 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","publish_time":1424539781394,"_cnpm_publish_time":1424539781394,"dist-tags":{"latest":"1.3.0"}}