mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
I think fixes downloads
This commit is contained in:
3
devtools_options.yaml
Normal file
3
devtools_options.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
description: This file stores settings for Dart & Flutter DevTools.
|
||||||
|
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||||
|
extensions:
|
||||||
@@ -131,10 +131,7 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
|
|||||||
}
|
}
|
||||||
final minZoom = OfflineAreaService().findDynamicMinZoom(bounds);
|
final minZoom = OfflineAreaService().findDynamicMinZoom(bounds);
|
||||||
final maxZoom = _zoom.toInt();
|
final maxZoom = _zoom.toInt();
|
||||||
final allTiles = OfflineAreaService().computeTileList(bounds, minZoom, maxZoom);
|
final nTiles = OfflineAreaService().computeTileList(bounds, minZoom, maxZoom).length;
|
||||||
final worldTiles = OfflineAreaService().computeTileList(
|
|
||||||
OfflineAreaService().globalWorldBounds(), 1, 4);
|
|
||||||
final nTiles = allTiles.length + worldTiles.length;
|
|
||||||
const kbPerTile = 6.5; // Empirically ~6.5kB average for OSM tiles at z=1-19
|
const kbPerTile = 6.5; // Empirically ~6.5kB average for OSM tiles at z=1-19
|
||||||
final totalMb = (nTiles * kbPerTile) / 1024.0;
|
final totalMb = (nTiles * kbPerTile) / 1024.0;
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -193,10 +193,13 @@ class OfflineAreaService {
|
|||||||
await saveAreasToDisk();
|
await saveAreasToDisk();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// STEP 1: Tiles (incl. global z=1..4)
|
// STEP 1: Tiles: user areas get only their bbox/zooms; world area gets only global z=1..4
|
||||||
final tileTasks = computeTileList(bounds, minZoom, maxZoom);
|
Set<List<int>> allTiles;
|
||||||
final globalTiles = computeTileList(globalWorldBounds(), 1, 4);
|
if (area.isPermanent) {
|
||||||
final allTiles = {...tileTasks, ...globalTiles};
|
allTiles = computeTileList(globalWorldBounds(), 1, 4);
|
||||||
|
} else {
|
||||||
|
allTiles = computeTileList(bounds, minZoom, maxZoom);
|
||||||
|
}
|
||||||
area.tilesTotal = allTiles.length;
|
area.tilesTotal = allTiles.length;
|
||||||
|
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user