setOffline function

Future<void> setOffline(
  1. bool offline
)

Forces MapLibre offline, or gives the network state back to the system.

With true, MapLibre stops requesting tiles, styles, sprites and glyphs from the network and draws from what is already in the cache or in downloaded offline regions. With false, it follows the device's network state again. The setting applies to every map in the app.

Android only. Throws an UnsupportedError on iOS, where the MapLibre iOS SDK has no offline switch, and on web.

Implementation

Future<void> setOffline(bool offline) => _global.setOffline(offline);