From e5a7ec709cac6b33e8f44779db44d6f2198b4552 Mon Sep 17 00:00:00 2001 From: Luka S Date: Wed, 23 Aug 2023 20:29:55 +0100 Subject: [PATCH] Fixed `TileLayer.reset` (#1620) Co-authored-by: Rory Stephenson --- lib/src/layer/overlay_image_layer.dart | 2 +- lib/src/layer/tile_layer/tile_layer.dart | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/src/layer/overlay_image_layer.dart b/lib/src/layer/overlay_image_layer.dart index 68d53c0df..2bc7abd6e 100644 --- a/lib/src/layer/overlay_image_layer.dart +++ b/lib/src/layer/overlay_image_layer.dart @@ -150,7 +150,7 @@ class OverlayImageLayer extends StatelessWidget { return ClipRect( child: Stack( children: [ - for (var overlayImage in overlayImages) + for (final overlayImage in overlayImages) overlayImage.buildPositionedForOverlay(map), ], ), diff --git a/lib/src/layer/tile_layer/tile_layer.dart b/lib/src/layer/tile_layer/tile_layer.dart index 799048d58..be7f97b25 100644 --- a/lib/src/layer/tile_layer/tile_layer.dart +++ b/lib/src/layer/tile_layer/tile_layer.dart @@ -320,11 +320,10 @@ class _TileLayerState extends State with TickerProviderStateMixin { super.initState(); if (widget.reset != null) { - _resetSub = widget.reset?.listen( - (_) => _tileImageManager.removeAll( - widget.evictErrorTileStrategy, - ), - ); + _resetSub = widget.reset?.listen((_) { + _tileImageManager.removeAll(widget.evictErrorTileStrategy); + _loadAndPruneInVisibleBounds(MapCamera.of(context)); + }); } _tileRangeCalculator = TileRangeCalculator(tileSize: widget.tileSize);