Tile Loading Interceptor
To track (eg. for debugging and logging) the internal tile loading mechanisms, FMTCTileProvider.tileLoadingInterceptor
may be used.
For example, this could be used to debug why tiles aren't loading as expected (perhaps in combination with TileLayer.tileBuilder
& ValueListenableBuilder
as in the example app & below), or to perform more advanced monitoring and logging (than the hit & miss statistics provide).
The interceptor uses a ValueNotifier
, which allows FMTC internals to notify & push updates of tile loads, and allows the owner to listen for changes as well as retrieve the latest update (value
) immediately.
The object within the ValueNotifier
is a mapping of TileCoordinates
to TileLoadingInterceptorResult
s. These result objects contain multiple fields, which can be explored in the Full API Documentation:
link
Example
See the following example, which demonstrates how to listen directly to it, and how to use it in combination with a custom tileBuilder
using a ValueListenableBuilder
to listen to it in a widget tree.
Last updated