kvision / pl.treksoft.kvision.cordova / Geolocation

Geolocation

object Geolocation

Main geolocation object based on webview api.

Functions

clearWatch

fun clearWatch(watchId: String): Unit

Clear the given watch.

getCurrentPosition

suspend fun getCurrentPosition(enableHighAccuracy: Boolean = true, timeout: Number? = null, maximumAge: Number? = null): Result<Position, GeolocationException>

Get current location.

watchPosition

suspend fun watchPosition(enableHighAccuracy: Boolean = true, timeout: Number? = null, maximumAge: Number? = null, resultCallback: (Result<Position, GeolocationException>) -> Unit): String?

Watch location changes.

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.