{"id":13784398,"url":"https://github.com/developmentseed/cached-vector-tile","last_synced_at":"2025-06-23T21:40:54.995Z","repository":{"id":66924787,"uuid":"66093677","full_name":"developmentseed/cached-vector-tile","owner":"developmentseed","description":null,"archived":false,"fork":false,"pushed_at":"2016-08-19T16:21:10.000Z","size":111,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-06-07T23:53:25.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developmentseed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-08-19T15:46:44.000Z","updated_at":"2024-09-19T08:35:11.000Z","dependencies_parsed_at":"2023-05-26T05:16:02.468Z","dependency_job_id":null,"html_url":"https://github.com/developmentseed/cached-vector-tile","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/developmentseed/cached-vector-tile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fcached-vector-tile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fcached-vector-tile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fcached-vector-tile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fcached-vector-tile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developmentseed","download_url":"https://codeload.github.com/developmentseed/cached-vector-tile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fcached-vector-tile/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561180,"owners_count":23177543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T19:00:42.224Z","updated_at":"2025-06-23T21:40:54.955Z","avatar_url":"https://github.com/developmentseed.png","language":"JavaScript","readme":"# cached-vector-tile [![CircleCI](https://circleci.com/gh/developmentseed/cached-vector-tile.svg?style=svg)](https://circleci.com/gh/developmentseed/cached-vector-tile)\n\nAn alternative implementation of the [vector-tile-js](https://github.com/mapbox/vector-tile-js) interface that is backed by plain JS objects/arrays rather than parsed-on-demand protobuf data.  Trades away memory efficiency for faster feature.loadGeometry() calls.\n\n## Install and Use\n\n`npm install cached-vector-tile`\n\n```js\nvar Protobuf = require('pbf');\nvar VectorTile = require('vector-tile').VectorTile\nvar CachedVectorTile = require('cached-vector-tile')\n\nvar vt = new VectorTile(new Protobuf(rawdata))\n\nvar cached = new CachedVectorTile(vt)\n\nvar plain = cached.serialize()\n// 'plain' is a plain JS object, suitable for JSON.serialize() or storage in\n// something like IndexedDB\n```\n\n## API\n\n### CachedVectorTile\n\nA vector tile.  Implements the interface defined in the [vector-tile-js API reference](https://github.com/mapbox/vector-tile-js) (except that the constructor is different).\n\n**Parameters**\n\n-   `vt` **(VectorTile | [CachedVectorTile](#cachedvectortile) \\| [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** The vector tile to clone.  Can be a [vector-tile-js](https://github.com/mapbox/vector-tile-js) tile, a CachedVectorTile, or a plain JS object as serialized by [CachedVectorTile#serialize](#serialize)\n-   `properties` **\\[[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** An optional object mapping feature ids to property values.  If provided, these properties will be used instead of the ones present in vt's features.\n\n#### serialize\n\nReturns a plain JS object representation of the vector tile.\n\n### CachedVectorTileLayer\n\nA vector tile layer.  Implements the interface defined in the [vector-tile-js API reference](https://github.com/mapbox/vector-tile-js)\n\n#### serialize\n\nReturns a plain JS object representation of the vector tile layer.\n\n### CachedVectorTileFeature\n\nA vector tile feature.  Implements the interface defined in the [vector-tile-js API reference](https://github.com/mapbox/vector-tile-js).\n\n#### serialize\n\nReturns a plain JS object representation of the vector tile feature.\n","funding_links":[],"categories":["Uncategorized","Parsers \u0026 Generators"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fcached-vector-tile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmentseed%2Fcached-vector-tile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fcached-vector-tile/lists"}