NetworkTileProvider constructor

NetworkTileProvider({
  1. Map<String, String> headers = const {},
  2. BaseClient? httpClient,
})

TileProvider to fetch tiles from the network

By default, a RetryClient is used to retry failed requests. 'dart:http' or 'dart:io' might be needed to override this.

On the web, the 'User-Agent' header cannot be changed as specified in TileLayer.tileProvider's documentation, due to a Dart/browser limitation.

Implementation

NetworkTileProvider({
  super.headers = const {},
  BaseClient? httpClient,
}) : httpClient = httpClient ?? RetryClient(Client());