unpack static method
Unpacks a mobile map package file (.mmpk) to an output directory.
If the last level of the mobileMapPackageFileUri
is not present, it will
be created as part of the unpack task. The unpack task writes the full
content of the mobile map package to the output directory. Care should be
taken on devices with limited storage space, especially if the original
package is very large. After unpacking, you can remove the original .mmpk
file from the device.
Note that unpacking will fail if the package is expired and was authored as ExpirationType.preventExpiredAccess.
Parameters:
mobileMapPackageFileUri
— The path to a mobile map package file (.mmpk)outputDirectory
— The path to a directory to write the mobile map package contents. This path must be specified without a trailing slash.
Return Value: Future with no return value.
Implementation
static Future<void> unpack(
{required Uri mobileMapPackageFileUri, required Uri outputDirectory}) {
_initializeArcGISEnvironmentIfNeeded();
final coreMobileMapPackageFileUri =
_CString(mobileMapPackageFileUri.toFilePath());
final coreOutputDirectory = _CString(outputDirectory.toFilePath());
final taskHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_MobileMapPackage_unpackAsync(
coreMobileMapPackageFileUri.bytes,
coreOutputDirectory.bytes,
errorHandler);
});
return taskHandle.toFuture((_) {});
}