Location Info
The library for determining the real geographic location of device.
Permissions
Permissions=Location;Internet
Dependency libraries
Qt5CoreQt5Positioning
Features
- Check is supported.
- Gets the available positioning methods.
- Listen to positions with their time, altitude, horizontal and vertical accuracy, speed and direction.
- Choose positioning accuracy:
BalancedorHigh(satellite). - Positioning errors.
Example
val id = LocationInfo.listen(
accuracy = LocationAccuracy.High, // Balanced (the default) allows other methods
onError = { error -> println("positioning failed: $error") }, // AccessDenied, Closed, Unavailable, Unknown
) { _, state ->
println("${state.latitude}, ${state.longitude} ±${state.horizontalAccuracy ?: "?"} m at ${state.timestamp}")
}
LocationInfo.unlisten(id)