min zoom for offline areas is now max world zoom + 1

This commit is contained in:
stopflock
2025-08-19 17:54:27 -05:00
parent 7875fd0d58
commit 268c9ebb3a
2 changed files with 1 additions and 12 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
LatLng(bounds.northEast.latitude, bounds.northEast.longitude + epsilon)
);
}
final minZoom = findDynamicMinZoom(bounds);
final minZoom = kWorldMaxZoom + 1; // Use world max zoom + 1 for seamless zoom experience
final maxZoom = _zoom.toInt();
final nTiles = computeTileList(bounds, minZoom, maxZoom).length;
final totalMb = (nTiles * kTileEstimateKb) / 1024.0;
@@ -56,17 +56,6 @@ List<int> latLonToTile(double lat, double lon, int zoom) {
return [xtile, ytile];
}
int findDynamicMinZoom(LatLngBounds bounds, {int maxSearchZoom = 19}) {
for (int z = 1; z <= maxSearchZoom; z++) {
final swTile = latLonToTile(bounds.southWest.latitude, bounds.southWest.longitude, z);
final neTile = latLonToTile(bounds.northEast.latitude, bounds.northEast.longitude, z);
if (swTile[0] != neTile[0] || swTile[1] != neTile[1]) {
return z - 1 > 0 ? z - 1 : 1;
}
}
return maxSearchZoom;
}
LatLngBounds globalWorldBounds() {
// Use slightly shrunken bounds to avoid tile index overflow at extreme coordinates
return LatLngBounds(LatLng(-85.0, -179.9), LatLng(85.0, 179.9));