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.
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.
- mapbox_maps_flutter
Official Mapbox Maps SDK for Flutter to render interactive vector maps.
92Compare - maplibre_gl
Native MapLibre maps for Android, iOS and Web with vector tiles, PMTiles, GeoJSON and offline support
91Compare - maplibre
Performant vector maps for Flutter supporting Mapbox Vector Tiles across all six platforms.
90Compare - vector_map_tiles_mbtiles
Mapbox MBTiles vector tile provider for flutter_map for offline maps
79Compare
Works with
Packages commonly used together with vector_tile: ones it builds on, ones built on it, and its own family.
- fixnumvector_tile depends on itProvides 32‑ and 64‑bit signed fixed‑width integer types for Dart.
- protobufvector_tile depends on itProvides runtime support for Dart protocol buffer messages generated by protoc_plugin.
- vector_tile_rendererBuilt on vector_tileVector tile renderer for creating map tile images or writing to a canvas.