s2-vector-tile
TypeScript icon, indicating that this package has built-in type declarations

2.0.12 • Public • Published

s2-vector-tile npm downloads bundlephobia JavaScript Style Guide

About

A Modified TypeScript implementation of the Mapbox Vector Tile library. It is backwards compatible but offers a lot of new features and improvements including proper module treeshake.

Install

# npm
npm install s2-vector-tile
# pnpm
pnpm add s2-vector-tile
# yarn
yarn add s2-vector-tile

Example use

const fs = from 'fs'
import { VectorTile } from 's2-vector-tile'

const fixture = fs.readFileSync('./fixtures/14-8801-5371.vector.pbf')

const tile = new VectorTile(fixture) // load the protobuf parsing it directly

console.log(tile)

let { landuse } = tile.layers // 107 features

console.log(landuse.feature(0))
console.log(landuse.feature(0).loadGeometry())

Readme

Keywords

Package Sidebar

Install

npm i s2-vector-tile

Weekly Downloads

94

Version

2.0.12

License

BSD-3-Clause

Unpacked Size

149 kB

Total Files

43

Last publish

Collaborators

  • oconnorct1