@@ -12,6 +12,7 @@ import 'package:flutter_map/src/layer/tile_layer/tile_image_manager.dart';
12
12
import 'package:flutter_map/src/layer/tile_layer/tile_range.dart' ;
13
13
import 'package:flutter_map/src/layer/tile_layer/tile_range_calculator.dart' ;
14
14
import 'package:flutter_map/src/layer/tile_layer/tile_scale_calculator.dart' ;
15
+ import 'package:http/http.dart' ;
15
16
import 'package:http/retry.dart' ;
16
17
import 'package:logger/logger.dart' ;
17
18
@@ -362,7 +363,7 @@ class _TileLayerState extends State<TileLayer> with TickerProviderStateMixin {
362
363
_tileUpdateSubscription = mapController.mapEventStream
363
364
.map ((mapEvent) => TileUpdateEvent (mapEvent: mapEvent))
364
365
.transform (widget.tileUpdateTransformer)
365
- .listen ((event) => _onTileUpdateEvent (event) );
366
+ .listen (_onTileUpdateEvent);
366
367
}
367
368
368
369
var reloadTiles = false ;
@@ -629,13 +630,13 @@ class _TileLayerState extends State<TileLayer> with TickerProviderStateMixin {
629
630
required bool pruneAfterLoad,
630
631
}) {
631
632
final tileZoom = tileLoadRange.zoom;
632
- tileLoadRange = tileLoadRange.expand (widget.panBuffer);
633
+ final expandedTileLoadRange = tileLoadRange.expand (widget.panBuffer);
633
634
634
635
// Build the queue of tiles to load. Marks all tiles with valid coordinates
635
636
// in the tileLoadRange as current.
636
637
final tileBoundsAtZoom = _tileBounds.atZoom (tileZoom);
637
638
final tilesToLoad = _tileImageManager.createMissingTiles (
638
- tileLoadRange ,
639
+ expandedTileLoadRange ,
639
640
tileBoundsAtZoom,
640
641
createTile: (coordinates) => _createTileImage (
641
642
coordinates: coordinates,
@@ -645,7 +646,7 @@ class _TileLayerState extends State<TileLayer> with TickerProviderStateMixin {
645
646
);
646
647
647
648
// Re-order the tiles by their distance to the center of the range.
648
- final tileCenter = tileLoadRange .center;
649
+ final tileCenter = expandedTileLoadRange .center;
649
650
tilesToLoad.sort (
650
651
(a, b) => _distanceSq (a.coordinates, tileCenter)
651
652
.compareTo (_distanceSq (b.coordinates, tileCenter)),
@@ -681,7 +682,7 @@ class _TileLayerState extends State<TileLayer> with TickerProviderStateMixin {
681
682
_pruneLater? .cancel ();
682
683
_pruneLater = Timer (
683
684
fadeIn.duration + const Duration (milliseconds: 50 ),
684
- () => _pruneWithCurrentCamera () ,
685
+ _pruneWithCurrentCamera,
685
686
);
686
687
});
687
688
}
0 commit comments