create

suspend fun create(context: Context, mapId: Int, token: String, config: SessionConfig = SessionConfig()): MapSession

Creates a session for the given map, fetching its data from the Wemap backend.

Return

A ready-to-use session.

Parameters

context

An Android context; the application context is retained for sensor access.

mapId

The identifier of the map to load, as found on the Wemap dashboard.

token

The access token authorizing the request.

config

Tunable session-wide settings. Defaults to SessionConfig().

Throws

if the map data cannot be fetched or decoded.


suspend fun create(context: Context, offlineZip: File, config: SessionConfig = SessionConfig()): MapSession

Creates a session from an offline map bundle instead of fetching the map from the backend.

Return

A ready-to-use session backed by the offline bundle.

Parameters

context

An Android context; the application context is retained for sensor access.

offlineZip

A zip archive containing the map's offline data, as produced by the packdata service.

config

Tunable session-wide settings. Defaults to SessionConfig().

Throws

if the archive cannot be read or its map data decoded.