tbh not sure, left for a bit. sorry. pretty sure closer than last commit..

This commit is contained in:
stopflock
2025-08-09 22:44:24 -05:00
parent 000bb6c567
commit 63675bd18a
6 changed files with 36 additions and 122 deletions
@@ -9,11 +9,17 @@ final _tileFetchSemaphore = _SimpleSemaphore(4); // Max 4 concurrent
/// Fetches a tile from OSM, with in-memory retries/backoff, and global concurrency limit.
/// Returns tile image bytes, or throws on persistent failure.
import '../../app_state.dart';
Future<List<int>> fetchOSMTile({
required int z,
required int x,
required int y,
}) async {
if (AppState().offlineMode) {
print('[fetchOSMTile] BLOCKED by offline mode ($z/$x/$y)');
throw Exception('Offline mode enabled—cannot fetch OSM tile.');
}
final url = 'https://tile.openstreetmap.org/$z/$x/$y.png';
const int maxAttempts = 3;
int attempt = 0;