synchronizeBaseMapTiles method

  1. @override
Future<MPError?> synchronizeBaseMapTiles(
  1. OnBaseMapCacheProgressListener? onProgress
)
override

Implementation

@override
Future<MPError?> synchronizeBaseMapTiles(
    OnBaseMapCacheProgressListener? onProgress) async {
  if (_isSynchronizing) {
    throw StateError(
        "A base-map tile synchronization is already running. Await the previous synchronizeBaseMapTiles call before starting another.");
  }
  _isSynchronizing = true;
  _onProgressListener = onProgress;
  try {
    final error = await dataSetCacheMethodChannel
        .invokeMethod("DSC_synchronizeBaseMapTiles");
    return MPError.fromJson(error);
  } finally {
    _onProgressListener = null;
    _isSynchronizing = false;
  }
}