VpsLocalLocationSource

class VpsLocalLocationSource(context: Context, mapDatabaseDirectory: File, mapData: MapData, previewView: PreviewView? = null, foregroundService: VpsLocalForegroundService.Config? = null) : LocationSource, AttitudeSource

Offline visual positioning location source.

Works like com.getwemap.sdk.positioning.wemapvpsarcore WemapVPSARCoreLocationSource, but fully offline (no VPS network service) and without ARCore: camera frames are captured via CameraX and matched against a pre-built map database on the device.

The map database files (descriptors.bq, reloc-simplified.db, georef.db) are large and must be downloaded by the SDK user in advance and passed via mapDatabaseDirectory.

Position updates are discrete: a fix is produced only on a successful scan and held until the next one — there is no continuous visual tracking between scans (unlike ARCore SLAM).

Parameters

context

application context.

mapDatabaseDirectory

directory containing the downloaded map database files.

mapData

mapdata

previewView

optional CameraX preview surface. When supplied, the source binds a live camera preview alongside its capture use case so the app can show the feed while scanning; the source owns the camera, so apps must NOT bind their own camera session. Pass null for headless (no preview).

foregroundService

optional configuration that keeps scanning alive while the app is backgrounded or the screen is off, via a camera-type foreground service (VpsLocalForegroundService). When null (the default), scanning only runs while the app is in the foreground. When supplied, the consuming app MUST declare the service and its permissions in its own manifest — see VpsLocalForegroundService.

Constructors

Link copied to clipboard
constructor(context: Context, mapDatabaseDirectory: File, mapData: MapData, previewView: PreviewView? = null, foregroundService: VpsLocalForegroundService.Config? = null)

Types

Link copied to clipboard

Outcome of a single scan iteration.

Link copied to clipboard

Whether the periodic scan loop is currently scanning.

Properties

Link copied to clipboard
open override var attitudeAccuracy: Int
Link copied to clipboard
open override var attitudeListener: AttitudeSourceListener?
Link copied to clipboard

Current device inclination in degrees (90° = upright), or null before the first attitude.

Link copied to clipboard
open override var isStarted: Boolean
Link copied to clipboard
open override var listener: LocationSourceListener?
Link copied to clipboard
open override val supportsHeading: Boolean = true

Functions

Link copied to clipboard
open override fun deinit()
Link copied to clipboard
open override fun start()
Link copied to clipboard
fun startScan()

Resume scanning within a started session (camera stays bound).

Link copied to clipboard
open override fun stop()
Link copied to clipboard
fun stopScan()

Pause scanning without tearing down the camera.