new change to use intaleq_map sdk 04-16-4
This commit is contained in:
@@ -103,4 +103,19 @@ class OfflineMapService {
|
||||
2;
|
||||
return 12742 * math.asin(math.sqrt(a));
|
||||
}
|
||||
|
||||
/// Clears all offline map regions and tiles from local storage
|
||||
Future<void> clearCache() async {
|
||||
try {
|
||||
Log.print("♻️ Purging MapLibre Offline Cache...");
|
||||
// In maplibre_gl 0.25.0, we use top-level functions instead of an OfflineManager class
|
||||
final List<OfflineRegion> regions = await getListOfRegions();
|
||||
for (var region in regions) {
|
||||
await deleteOfflineRegion(region.id);
|
||||
}
|
||||
Log.print("✅ Map cache cleared successfully. ${regions.length} regions removed.");
|
||||
} catch (e) {
|
||||
Log.print("⚠️ Failed to clear map cache: $e");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user