Expose RetryClient in NetworkTileProvider initialisation#1297
Expose RetryClient in NetworkTileProvider initialisation#1297MichalTorma wants to merge 6 commits intofleaflet:masterfrom
Conversation
ibrierley
left a comment
There was a problem hiding this comment.
So, out of interest, what would be a good example code that someone would use as the optional RetryClient ?
Hi there, TileLayerOptions(
tileProvider: NetworkTileProvider(
retryClient: RetryClient(
Client(),
retries: 10,
when: (p0) => p0.headers['content-type'] != 'image/png',
)),
wmsOptions: WMSTileLayerOptions(
baseUrl: 'https://openwms.statkart.no/skwms1/wms.topo4?',
layers: ['topo4_WMS'],
version: '1.3.0',
format: 'image/png',
crs: const Epsg3857(),
transparent: false)), |
|
This will conflict with #1294, but it's not too much of an issue, so I'm happy for it to be merged ahead. |
|
@MichalTorma Hi there, I've had to make some unexpected changes to #1294, which includes the changes that PR made. You can see the commit which did this: ad2adb6. As a result, I'm going to close this PR. Many thanks for your contribution, it's greatly appreciated! |
This pull request adds optional parameter
RetryClientforNetworkTileProvider. I made this fork to scratch my own itch with some stubborn tile servers that are either too slow or don't follow the standard conventions. Some servers require longer cooldown between the requests therefore more than 3 retries are needed (as was the default inNetworkImageWithRetry).