Skip to content
pubscout

vector_tile

4.0.0, released 8 months ago by an unverified publisher

Encode and decode Mapbox Vector Tile (MVT) files to/from raw and GeoJSON formats.

WASM-ready
$ flutter pub add vector_tile
Source repository

What it does

The package parses .mvt/.pbf files into a raw vector tile structure and can convert features to GeoJSON. It also allows creating vector tiles from raw data and writing them as protobuf files.

AI-written summary of version 4.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to read or write Mapbox Vector Tiles in a Flutter/Dart app
  • You want to convert vector tile features to GeoJSON for further processing

Skip it when

  • You require encoding from GeoJSON directly (not yet supported)
  • You need high‑level map rendering widgets (this package only handles data)

Strengths

  • Supports both decoding and encoding of raw vector tiles
  • Works on all major platforms including web and desktop

Weaknesses

  • No direct GeoJSON‑to‑tile encoding yet
  • Limited to raw tile manipulation, no map UI integration

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'vector_tile/vector_tile.dart';

void main() async {
  final data = await File('sample.pbf').readAsBytes();
  final tile = await VectorTile.fromBytes(bytes: data);
  final layer = tile.layers.first;
  for (var f in layer.features) {
    f.decodeGeometry();
    var geo = f.toGeoJson<GeoJsonPoint>(x: 0, y: 0, z: 0);
    print(geo?.geometry?.coordinates);
  }
}

Alternatives

Packages that do the same job and could replace vector_tile.

Works with

Packages commonly used together with vector_tile: ones it builds on, ones built on it, and its own family.