Tile Providers

The tileProvider parameter in TileLayer takes a TileProvider object specifying a tile provider to use for that layer.

This has a default of NetworkTileProvider which gets tiles from the internet through a dedicated image provider.

There's two situations in which you'll need to change the tile provider:

Network Tile Provider

NetworkTileProvider takes two arguments, but you'll usually never need to specify them:

  • httpClient: custom BaseClient By default, a RetryClient backed by a standard Client is used

  • headers: custom Map<String, String> By default, only the default headers, plus a custom 'User-Agent' header based on the userAgentPackageName property, are included with each request

Local Tile Providers

These tile providers use the templateUrl to get the appropriate tile from the asset store of the application, or from a file on the users device, respectively.

AssetTileProvider

This tile providers uses the templateUrl to get the appropriate tile from the asset store of the application.

FileTileProvider

This tile providers uses the templateUrl to get the appropriate tile from the a path/directory/file on the user's device - either internal application storage or external storage.

Offline Mapping

Offline Mapping

Last updated

Was this helpful?