vector_map_tiles_pmtiles 1.2.0 copy "vector_map_tiles_pmtiles: ^1.2.0" to clipboard
vector_map_tiles_pmtiles: ^1.2.0 copied to clipboard

PMTiles tile provider for vector_map_tiles (flutter_map vector tiles). It uses HTTP Range Requests to request tiles from a single local or hosted file.

example/example.md

Basic usage #

/// Initiate your tile provider.
/// The source can be a PMTiles file that is either hosted or local on 
/// your file system. flutter assets however are not supported.
final _futureTileProvider = PmTilesVectorTileProvider
    .fromSource('eitherAnUrlOrFileSystemPath');

/// The theme specifies the look of the rendered map.
/// Note: Styles from Mapbox, OpenMapTiles and others and not compatible
/// with Protomaps styles.
final mapTheme = ProtomapsThemes.light();

@override
Widget build(BuildContext context) {
  return FlutterMap(
    options: MapOptions(),
    children: [
      VectorTileLayer(
        // the map theme
        theme: mapTheme,

        tileProviders: TileProviders({
          // the awaited vector tile provider
          'protomaps': tileProvider,
        }),

        // disable the file cache when you change the PMTiles source
        // fileCacheTtl: Duration.zero,
      ),
    ],
  );
}

Need more information? #

2
likes
140
pub points
64%
popularity

Publisher

verified publisherjoscha-eckert.de

PMTiles tile provider for vector_map_tiles (flutter_map vector tiles). It uses HTTP Range Requests to request tiles from a single local or hosted file.

Repository (GitHub)
View/report issues

Topics

#flutter-map #vector-map-tiles #map #pmtiles

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, pmtiles, vector_map_tiles, vector_tile_renderer

More

Packages that depend on vector_map_tiles_pmtiles