Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setConnected fully impelementation #491

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
installOfflineMapTiles(tilesDb);
result.success(null);
break;
case "setOffline":
boolean offline = methodCall.argument("offline");
ConnectivityReceiver.instance(context).setConnected(offline ? false : null);
case "setMapLibreOffline":
Boolean offline = (Boolean) methodCall.argument("offline");
ConnectivityReceiver.instance(context).setConnected(offline!=null ? !(offline) : null);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use !offline.booleanValue() to make the conversion explicit. Also, please add spaces around !=.

result.success(null);
break;
case "mergeOfflineRegions":
Expand Down
2 changes: 1 addition & 1 deletion maplibre_gl/lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ class MapLibreMapController extends ChangeNotifier {
}

Future clearAmbientCache() async {
return _maplibrePlatform.clearAmbientCache();
return _maplibrePlatform.invalidateAmbientCache();//clearAmbientCache();
}

/// Get last my location
Expand Down
4 changes: 2 additions & 2 deletions maplibre_gl/lib/src/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Future<void> installOfflineMapTiles(String tilesDb) async {

enum DragEventType { start, drag, end }

Future<dynamic> setOffline(bool offline) => _globalChannel.invokeMethod(
'setOffline',
Future<dynamic> setMapLibreOffline(bool? offline) => _globalChannel.invokeMethod(
'setMapLibreOffline',
<String, dynamic>{
'offline': offline,
},
Expand Down