TileUpdateTransformer typedef
Restricts and limits TileUpdateEvents (which are emitted 'by' MapEvents), which cause the tiles of the TileLayer to update (see below).
When a MapEvent occurs, a TileUpdateEvent is also emitted (containing that event) by the internals. However, it is sometimes unnecessary for all MapEvents to result in a TileUpdateEvent, which can be expensive and time-consuming. Alternatively, some TileUpdateEvents may be grouped together to reduce the rate at which tiles are updates.
By default, TileUpdateEvents both prune old tiles and load new tiles, as necessary. However, this may not also be required.
A TileUpdateTransformer transforms/converts the incoming stream of TileUpdateEvents (one per every MapEvent) into a 'new' stream of TileUpdateEvents, at any rate, with any desired pruning/loading configuration.
TileUpdateTransformers defines a built-in set of transformers. TileLayer uses TileUpdateTransformers.ignoreTapEvents by default.
If neccessary, you can build your own using StreamTransformer, usually
StreamTransformer.fromHandlers, adding events to the exposed EventSink
if the incoming event should cause an update. Most implementations should
check TileUpdateEvent.wasTriggeredByTap before emitting an event, and
avoid emitting an event if this is true
.
Implementation
typedef TileUpdateTransformer
= StreamTransformer<TileUpdateEvent, TileUpdateEvent>;