From 14ebb4cb5f6d06b081606c292ded849957835fb0 Mon Sep 17 00:00:00 2001 From: Gabriel Palmisano Date: Thu, 9 Jan 2025 15:15:07 +0100 Subject: [PATCH] Revert "Implementation of clearAmbientCache functionality (#502)" This reverts commit 5a3daa23a46cd14b97c4348f2295c97f7a151086. --- .../maplibregl/MapLibreMapController.java | 18 ------------------ .../maplibre_gl/MapLibreMapController.swift | 9 --------- maplibre_gl/lib/src/controller.dart | 4 ---- .../src/maplibre_gl_platform_interface.dart | 1 - .../lib/src/method_channel_maplibre_gl.dart | 10 ---------- .../lib/src/maplibre_web_gl_platform.dart | 5 ----- 6 files changed, 47 deletions(-) diff --git a/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/MapLibreMapController.java b/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/MapLibreMapController.java index c856ed80c..94022f3cc 100644 --- a/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/MapLibreMapController.java +++ b/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/MapLibreMapController.java @@ -935,24 +935,6 @@ public void onError(@NonNull String message) { }); break; } - case "map#clearAmbientCache": - { - OfflineManager fileSource = OfflineManager.Companion.getInstance(context); - - fileSource.clearAmbientCache( - new OfflineManager.FileSourceCallback() { - @Override - public void onSuccess() { - result.success(null); - } - - @Override - public void onError(@NonNull String message) { - result.error("MAPBOX CACHE ERROR", message, null); - } - }); - break; - } case "source#addGeoJson": { final String sourceId = call.argument("sourceId"); diff --git a/maplibre_gl/ios/maplibre_gl/Sources/maplibre_gl/MapLibreMapController.swift b/maplibre_gl/ios/maplibre_gl/Sources/maplibre_gl/MapLibreMapController.swift index 6bfcf1fc1..f56ba21cb 100644 --- a/maplibre_gl/ios/maplibre_gl/Sources/maplibre_gl/MapLibreMapController.swift +++ b/maplibre_gl/ios/maplibre_gl/Sources/maplibre_gl/MapLibreMapController.swift @@ -158,15 +158,6 @@ class MapLibreMapController: NSObject, FlutterPlatformView, MLNMapViewDelegate, result(nil) } } - case "map#clearAmbientCache": - MLNOfflineStorage.shared.clearAmbientCache { - error in - if let error = error { - result(error) - } else { - result(nil) - } - } case "map#updateMyLocationTrackingMode": guard let arguments = methodCall.arguments as? [String: Any] else { return } if let myLocationTrackingMode = arguments["mode"] as? UInt, diff --git a/maplibre_gl/lib/src/controller.dart b/maplibre_gl/lib/src/controller.dart index de9a92ce8..7d247fab1 100644 --- a/maplibre_gl/lib/src/controller.dart +++ b/maplibre_gl/lib/src/controller.dart @@ -1112,10 +1112,6 @@ class MapLibreMapController extends ChangeNotifier { return _maplibrePlatform.invalidateAmbientCache(); } - // Future clearAmbientCache() async { - // return _maplibrePlatform.clearAmbientCache(); - // } - /// Get last my location /// /// Return last latlng, nullable diff --git a/maplibre_gl_platform_interface/lib/src/maplibre_gl_platform_interface.dart b/maplibre_gl_platform_interface/lib/src/maplibre_gl_platform_interface.dart index d748807c1..9f6bb1a86 100644 --- a/maplibre_gl_platform_interface/lib/src/maplibre_gl_platform_interface.dart +++ b/maplibre_gl_platform_interface/lib/src/maplibre_gl_platform_interface.dart @@ -74,7 +74,6 @@ abstract class MapLibrePlatform { Future querySourceFeatures( String sourceId, String? sourceLayerId, List? filter); Future invalidateAmbientCache(); - Future clearAmbientCache(); Future requestMyLocationLatLng(); Future getVisibleRegion(); diff --git a/maplibre_gl_platform_interface/lib/src/method_channel_maplibre_gl.dart b/maplibre_gl_platform_interface/lib/src/method_channel_maplibre_gl.dart index 3272a2501..40ca381f3 100644 --- a/maplibre_gl_platform_interface/lib/src/method_channel_maplibre_gl.dart +++ b/maplibre_gl_platform_interface/lib/src/method_channel_maplibre_gl.dart @@ -323,16 +323,6 @@ class MapLibreMethodChannel extends MapLibrePlatform { } } - @override - Future clearAmbientCache() async { - try { - await _channel.invokeMethod('map#clearAmbientCache'); - return null; - } on PlatformException catch (e) { - return Future.error(e); - } - } - @override Future requestMyLocationLatLng() async { try { diff --git a/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart b/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart index a6ad2b7ec..426f89f57 100644 --- a/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart +++ b/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart @@ -355,11 +355,6 @@ class MapLibreMapController extends MapLibrePlatform print('Offline storage not available in web'); } - @override - Future clearAmbientCache() async { - print('Offline storage not available in web'); - } - @override Future requestMyLocationLatLng() async { return _myLastLocation;