fake-geolocation
    Preparing search index...

    Interface MutableLocationServices

    A mutable virtual location services API that virtual users can use to manipulate the location services status and coordinates.

    createUser for how to supply this to a virtual user.

    interface MutableLocationServices {
        acquireCoordinates: (
            enableHighAccuracy: boolean,
        ) => Promise<GeolocationCoordinates>;
        disable: () => void;
        enable: () => void;
        isEnabled: boolean;
        setHighAccuracyCoordinates: (
            coords: undefined | GeolocationCoordinates,
        ) => void;
        setLowAccuracyCoordinates: (
            coords: undefined | GeolocationCoordinates,
        ) => void;
        subscribe: (subscriber: LocationServicesSubscriber) => () => void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    acquireCoordinates: (
        enableHighAccuracy: boolean,
    ) => Promise<GeolocationCoordinates>

    Acquire the coordinates.

    Type declaration

    An Error if the location services are disabled, or if the coordinates are unavailable.

    disable: () => void

    Disable the location services.

    enable: () => void

    Enable the location services.

    isEnabled: boolean

    Whether the location services are enabled.

    setHighAccuracyCoordinates: (coords: undefined | GeolocationCoordinates) => void

    Set the high accuracy coordinates.

    Type declaration

    setLowAccuracyCoordinates: (coords: undefined | GeolocationCoordinates) => void

    Set the low accuracy coordinates.

    Type declaration

    subscribe: (subscriber: LocationServicesSubscriber) => () => void

    Subscribe to changes in the coordinates.

    Type declaration