flutter_map_tile_switcher 0.0.4 copy "flutter_map_tile_switcher: ^0.0.4" to clipboard
flutter_map_tile_switcher: ^0.0.4 copied to clipboard

A flutter_map plugin for easy switching between map tile providers (OpenStreetMap, Google Maps, Satellite) with built-in caching and automatic dark mode support.

0.0.4 #

Web works now. The README always claimed it did, but tile_cache_manager.dart imported dart:io, so pub.dev correctly refused to tag the package as web compatible.

  • Tile store is now picked with a conditional import. Disk (FileCacheStore) on mobile and desktop, memory (MemCacheStore, 32 MB LRU) on web
  • New TileCacheManager.isInMemory, true on web, false everywhere else
  • Fix: setCacheMaxAge did nothing. The duration was tracked but never passed to the tile provider, so tiles only expired when the server said so. It is now wired through as maxStale, which means the documented 30 day default actually applies
  • Verified with a real flutter build web --release, wasm dry run passes too

Nothing to change on your side. If you were relying on tiles never expiring, call TileCacheManager.setCacheMaxAge() with a longer duration.

0.0.3 #

Not a breaking change, but worth doing: CARTO started requiring an API key on basemaps.cartocdn.com in late August 2026. Tiles still load without one, they just come back with an "API KEY REQUIRED" watermark.

  • Added optional apiKey on MapTileLayer, appended to the OSM tile URL as key
  • Added MapTileLayer.defaultApiKey so you can set the key once in main()
  • Empty or null key falls back to the old keyless URL, nothing breaks
  • API key is hashed into the widget cache key instead of stored in plain text
  • Bumped dependencies: flutter_map 8.3.2, flutter_map_cache 2.1.0, http_cache_file_store 2.0.2, path_provider 2.1.6, dio_cache_interceptor 4.0.7
  • Example now uses latlong2 0.10.1 and flutter_lints 6.0.0

If you were already caching watermarked tiles, call TileCacheManager.clearCache() once after adding your key.

0.0.2 #

  • Fixed dependency compatibility: use CacheStore base type for broader version support
  • Added pub.dev topics for better discoverability
  • Improved compatibility with lower-bound dependency versions

0.0.1 #

  • Initial release
  • 3 map tile providers: OpenStreetMap (CartoDB), Google Maps, Satellite (ArcGIS)
  • Built-in disk caching with configurable max age (default 30 days)
  • Automatic dark mode support for OSM and Google Maps
  • Locale-aware labels for Google Maps tiles
  • Widget caching to prevent unnecessary rebuilds
  • Fallback to non-cached tiles if cache initialization fails
0
likes
150
points
48
downloads

Documentation

API reference

Publisher

verified publisherorestislef.gr

Weekly Downloads

A flutter_map plugin for easy switching between map tile providers (OpenStreetMap, Google Maps, Satellite) with built-in caching and automatic dark mode support.

Repository (GitHub)
View/report issues

Topics

#map #flutter-map #tiles #caching #openstreetmap

License

(pending) (license)

Dependencies

dio_cache_interceptor, flutter, flutter_map, flutter_map_cache, http_cache_file_store, path_provider

More

Packages that depend on flutter_map_tile_switcher