mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-05-23 16:49:55 +02:00
min zoom for offline areas is now max world zoom + 1
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user