PickedMapFile

class PickedMapFile(val displayName: String, val extensionOrMime: String?, val read: suspend (maxBytes: Long) -> ByteArray?)(source)

A file the user picked, handed to MapLayersManager by whatever picker the platform uses.

The indirection is what makes the layer store common. Android resolves a content:// through a ContentResolver and desktop opens a plain path; neither detail belongs in the store, so the caller does the resolving and passes the bytes behind read.

Constructors

Link copied to clipboard
constructor(displayName: String, extensionOrMime: String?, read: suspend (maxBytes: Long) -> ByteArray?)

Properties

Link copied to clipboard

The name to show, and the base of the on-disk file name. Untrusted — see layerFileName.

Link copied to clipboard

File extension or MIME subtype, resolved to a LayerType by resolveLayerType.

Link copied to clipboard
val read: suspend (maxBytes: Long) -> ByteArray?

Reads at most maxBytes of the picked file. Null if it could not be opened, which is reported and skipped rather than thrown. The store asks for one byte more than it accepts, so a file over the limit is seen without being held whole.