From 41b81cec75fb9466e7669a2548017849c39586aa Mon Sep 17 00:00:00 2001 From: maRci002 Date: Wed, 8 Apr 2020 20:39:40 +0200 Subject: [PATCH] fix Flickering bug - on double click / MapController move (when zoom lvl changes) --- lib/src/layer/tile_layer.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/layer/tile_layer.dart b/lib/src/layer/tile_layer.dart index 0b0aaaed9..533c639b7 100644 --- a/lib/src/layer/tile_layer.dart +++ b/lib/src/layer/tile_layer.dart @@ -604,8 +604,6 @@ class _TileLayerState extends State with TickerProviderStateMixin { } _pruneTiles(); - - _setZoomTransforms(center, zoom); } void _setZoomTransforms(LatLng center, double zoom) { @@ -665,12 +663,14 @@ class _TileLayerState extends State with TickerProviderStateMixin { if (_tileZoom == null) { // if there is no _tileZoom available it means we are out within zoom level - // we will restory fully via _setView call if we are back on trail + // we will restore fully via _setView call if we are back on trail if ((options.maxZoom != null && tileZoom <= options.maxZoom) && (options.minZoom != null && tileZoom >= options.minZoom)) { _tileZoom = tileZoom; setState(() { _setView(map.center, tileZoom); + + _setZoomTransforms(map.center, map.zoom); }); } } else { @@ -678,6 +678,8 @@ class _TileLayerState extends State with TickerProviderStateMixin { if ((tileZoom - _tileZoom).abs() >= 1) { // It was a zoom lvl change _setView(map.center, tileZoom); + + _setZoomTransforms(map.center, map.zoom); } else { if (null == _throttleUpdate) { _update(null);