mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-01 05:29:35 +02:00
logging for debug map-no-update-until-move after caching tiles
This commit is contained in:
1 parent
bea942940b
commit
330c9e064c
2 files changed
+6
-1
No files matched your search
@@ -271,7 +271,11 @@ class _MapViewState extends State<MapView> {
|
|||||||
TileLayer(
|
TileLayer(
|
||||||
tileProvider: TileProviderWithCache(
|
tileProvider: TileProviderWithCache(
|
||||||
onTileCacheUpdated: () {
|
onTileCacheUpdated: () {
|
||||||
if (_debounceTileLayerUpdate != null) _debounceTileLayerUpdate!(() { if (mounted) setState(() {}); });
|
print('[MapView] onTileCacheUpdated fired (tile loaded)');
|
||||||
|
if (_debounceTileLayerUpdate != null) _debounceTileLayerUpdate!(() {
|
||||||
|
print('[MapView] Running debounced setState due to tile cache update');
|
||||||
|
if (mounted) setState(() {});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
urlTemplate: 'unused-{z}-{x}-{y}',
|
urlTemplate: 'unused-{z}-{x}-{y}',
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class TileProviderWithCache extends TileProvider {
|
|||||||
_tileCache[key] = Uint8List.fromList(bytes);
|
_tileCache[key] = Uint8List.fromList(bytes);
|
||||||
print('[TileProviderWithCache] Cached tile $key, bytes=${bytes.length}');
|
print('[TileProviderWithCache] Cached tile $key, bytes=${bytes.length}');
|
||||||
if (onTileCacheUpdated != null) {
|
if (onTileCacheUpdated != null) {
|
||||||
|
print('[TileProviderWithCache] Calling onTileCacheUpdated for $key');
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) => onTileCacheUpdated!());
|
SchedulerBinding.instance.addPostFrameCallback((_) => onTileCacheUpdated!());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user