com.maptiler.maptilersdk.offline

Types

@Serializable
data class MTBoundingBox(val minLon: Double, val minLat: Double, val maxLon: Double, val maxLat: Double)

A bounding box in WGS84 coordinates.

data class MTOfflineContext(val url: String, val resourceId: String? = null)

Provides additional context for an offline error.

A WorkManager worker responsible for downloading offline packs in the background.

sealed class MTOfflineError : Exception

Represents errors that can occur during the offline planning and downloading process.

Provides estimation for offline pack size and resource counts.

Manages the creation, retrieval, and deletion of offline map packs.

Represents a downloadable offline region.

@Serializable(with = MTOfflinePackMetadataSerializer::class)
data class MTOfflinePackMetadata(val id: String, var state: MTOfflinePackState, var size: Long, val createdAt: Instant, var expiresAt: Instant, val context: ByteArray? = null, val region: MTOfflineRegionDefinition, var totalResources: Int, var totalTileResources: Int, var downloadedResources: Int)

Metadata information about an offline pack.

@Serializable
data class MTOfflinePackProgress(val totalResources: Int, val downloadedResources: Int, val totalTileResources: Int, val downloadSpeed: Double = 0.0, val estimatedTimeRemaining: Double? = null)

Represents the download progress of an offline pack.

Represents the current state of an offline pack download.

@Serializable(with = MTOfflineRegionDefinitionSerializer::class)
data class MTOfflineRegionDefinition(val geometry: MTOfflineRegionGeometry, val minZoom: Int, val maxZoom: Int, val referenceStyle: MTMapReferenceStyle, val styleVariant: MTMapStyleVariant? = null, val pixelRatio: Float = 1.0f, val maxTileCount: Int? = null, val padding: Double? = null)

Defines a region for offline download.

@Serializable(with = MTOfflineRegionGeometrySerializer::class)
sealed class MTOfflineRegionGeometry

Represents the geometry of an offline region.

Errors that can occur during offline storage operations.

@Serializable
data class MTOfflineZoomRange(val minZoom: Int, val maxZoom: Int)

Represents a range of zoom levels for offline content.

data class MTPackStats(val expectedSize: Long, val resourceCount: Int, val tilesPerSource: Map<String, Int> = emptyMap())

Statistics about an offline map pack.

data class MTStyleDependencies(val sprites: List<MTStyleSprite>, val glyphsTemplate: String?, val sources: List<MTStyleSource> = emptyList(), val fontStacks: List<List<String>> = emptyList())

Represents the non-tile dependencies extracted from a style JSON.

A parser responsible for extracting offline dependencies (sprites and glyphs) from a style JSON payload.

data class MTStyleSource(val id: String, val type: String? = null, val url: String? = null, val tiles: List<String>? = null, val minZoom: Int? = null, val maxZoom: Int? = null)

Represents a tile source extracted from a style JSON.

@Serializable
data class MTStyleSprite(val id: String = "default", val url: String)

Represents a sprite defined in a map style.