Sask Vaccine Guide Code Docs
    Preparing search index...

    Interface for retrieving the device's location.

    interface default {
        compareLocations(l1: [number, number], l2: [number, number]): number;
        getLocation(): Promise<[number, number]>;
        isEnabled(): Promise<boolean>;
        requestPermission(): Promise<boolean>;
    }

    Implemented by

    Index

    Methods

    • Returns the distance between 2 latitude and longatude coordinates.

      Parameters

      • l1: [number, number]

        List with [latitude, longatude]. Latitude must be between -90 and 90 degrees. Longatude must be between must be between -180 and 180 degrees.

      • l2: [number, number]

      Returns number

      The distance between the 2 points in kilometers.

    • Get the user's last known location.

      Returns Promise<[number, number]>

      [latitude, longitude].

      LocationAccessError if it cannot access the user's location.

    • Checks if the user allows the app to access their location.

      Returns Promise<boolean>

      true if enabled, false otherwise

    • Request access to user location data.

      Returns Promise<boolean>

      true if permission is granted, false otherwise.