Compression

Provides methods for compressing and decompressing data using zip.js and lz-string.

Methods

static Cesium.Compression.compressToBase64(input)Promise.<string>

Compresses a string using zip.js and encodes it as base64.
Name Type Description
input string The input string to compress.
Returns:
- The compressed base64 string.

static Cesium.Compression.compressWithZip(filename, data)Promise.<Blob>

Compresses a string using zip.js and returns a Blob.
Name Type Description
filename string The name of the file inside the zip.
data string The string data to compress.
Returns:
- The compressed Blob.

static Cesium.Compression.decodeBase64Data(base64String)Promise.<Object>

Decodes a base64-encoded zip.js compressed JSON array.
Name Type Description
base64String string The base64 encoded compressed JSON array.
Returns:
- The decoded JSON object containing code, HTML, and baseHref.

static Cesium.Compression.decompressFromBase64(base64String)Promise.<string>

Decompresses a base64-encoded zip.js compressed string.
Name Type Description
base64String string The base64 encoded compressed data.
Returns:
- The decompressed string.

static Cesium.Compression.decompressWithZip(zipBlob)Promise.<Object>

Decompresses a zip Blob using zip.js.
Name Type Description
zipBlob Blob The zip Blob.
Returns:
- A mapping of filenames to their decompressed contents.
Need help? [email protected]