Location

A data class representing a geographic location.

A location can consist of a latitude, longitude, timestamp and other information such as bearing, altitude and velocity.

const onLocationChange = (value: Location, timestamp?: Date) => {
    console.log(value, timestamp);
};

COBI.mobile.location.read(onLocationChange); // Instantly get the current value
COBI.mobile.location.subscribe(onLocationChange);
COBI.mobile.location.unsubscribe(onLocationChange);
pageLocation
Example Response
{
    "coordinate": {
        "latitude": 37.785834,
        "longitude": -122.406417
    },
    "altitude": 0,
    "bearing": 0,
    "speed": 0,
    "horizontalAccuracy": 0,
    "verticalAccuracy": 0
}

Last updated