Skip to content

Commit

Permalink
Revert "Implementation of clearAmbientCache functionality (maplibre#502
Browse files Browse the repository at this point in the history
…)"

This reverts commit 5a3daa2.
  • Loading branch information
gabbopalma committed Jan 9, 2025
1 parent c6b4205 commit 14ebb4c
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions maplibre_gl/lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ abstract class MapLibrePlatform {
Future<List> querySourceFeatures(
String sourceId, String? sourceLayerId, List<Object>? filter);
Future invalidateAmbientCache();
Future clearAmbientCache();
Future<LatLng?> requestMyLocationLatLng();

Future<LatLngBounds> getVisibleRegion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<LatLng> requestMyLocationLatLng() async {
try {
Expand Down
5 changes: 0 additions & 5 deletions maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<LatLng?> requestMyLocationLatLng() async {
return _myLastLocation;
Expand Down

0 comments on commit 14ebb4c

Please sign in to comment.