NetworkTileProvider constructor
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.
Does not support cancellation of tile loading via TileProvider.getImageWithCancelLoadingSupport, as abortion of in-flight HTTP requests on the web is not yet supported in Dart.
Implementation
NetworkTileProvider({
super.headers,
BaseClient? httpClient,
}) : httpClient = httpClient ?? RetryClient(Client());