This package provide a cache for flutter_map
plugin using cached_network_image
package.
Features
cache images from network with cached_network_image
package.
all its features are available. check the CachedTileProvider
class.
Getting started
dependencies:
flutter_map_cached_tile_provider: ^0.0.1
Usage
Add the CachedTileProvider
to your FlutterMap
layers.
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_cached_tile_provider/flutter_map_cached_tile_provider.dart';
FlutterMap(
options: MapOptions(
plugins: [
CachedTileProviderPlugin(),
],
),
layers: [
TileLayer(
tileProvider: CachedTileProvider(), // use the CachedTileProvider
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
),
],
);
Additional information
you can change the cacheManager
and all other options of cached_network_image
package by passing them to the CachedTileProvider
constructor.
Other projects?
check my other projects:
- osrm: Open Source Routing Machine (OSRM) client for Dart.
- indexed: indexed widget, allow you to order the items inside stack, sothing like z-index
- kplayer: audio player that support all platforms.
- puncher: puncher is a flutter package that helps you to create a puncher widget.
Support/Job?
contact me: mohamadlounnas@gmail.com