Allow OSM offline downloads, disable button for restricted providers

Allow offline area downloads for OSM tile server. Move the "downloads
not permitted" check from inside the download dialog to the download
button itself — the button is now disabled (greyed out) when the
current tile type doesn't support offline downloads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Doug Borg
2026-03-07 12:34:01 -07:00
co-authored by Claude Opus 4.6
parent 2d92214bed
commit f3f40f36ef
4 changed files with 38 additions and 70 deletions
+2 -2
View File
@@ -70,13 +70,13 @@ class ServicePolicy {
attributionUrl = null;
/// OSM tile server (tile.openstreetmap.org)
/// Policy: no offline/bulk downloading, min 7-day cache, must honor cache headers.
/// Policy: min 7-day cache, must honor cache headers.
/// Concurrency managed by flutter_map's NetworkTileProvider.
/// https://operations.osmfoundation.org/policies/tiles/
const ServicePolicy.osmTileServer()
: maxConcurrentRequests = 0, // managed by flutter_map
minRequestInterval = null,
allowsOfflineDownload = false,
allowsOfflineDownload = true,
requiresClientCaching = true,
minCacheTtl = const Duration(days: 7),
attributionUrl = 'https://www.openstreetmap.org/copyright';