Skip to Content
API ReferenceLocationLocationGPSDataSource

LocationGPSDataSource

open class LocationGPSDataSource(locationClient: FusedLocationProviderClient, parentPlaceId: String? = null)

Data source that provides GPS-based locations via Google’s Fused Location Provider.

This class emits a Flow of LzLocation using callbackFlow to bridge the callback-based Fused Location Provider API into a reactive stream. It requests high-accuracy location updates with 1-second intervals (500ms fastest interval).

When a parentPlaceId is set, each GPS fix is checked against the parent place’s polygon boundary. If the fix falls within the polygon, the emitted LzLocation is tagged with the building context (parentPlaceId), enabling the SDK to associate outdoor GPS readings with a specific indoor venue. If the fix is outside the polygon or no parentPlaceId is provided, the location is emitted without building context.

See also

LocationMergedRepository

Constructors

LocationGPSDataSourceconstructor(locationClient: FusedLocationProviderClient, parentPlaceId: String ? = null)

Properties

locationsSource

open val locationsSource: Flow<LzLocation?>

Types: LzLocation

Last updated on