fake-geolocation
    Preparing search index...

    Interface LocationServices

    A virtual location services API that fake Geolocation APIs can use to acquire the coordinates, and subscribe changes in the coordinates.

    interface LocationServices {
        acquireCoordinates: (
            enableHighAccuracy: boolean,
        ) => Promise<GeolocationCoordinates>;
        isEnabled: boolean;
        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.

    isEnabled: boolean

    Whether the location services are enabled.

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

    Subscribe to changes in the coordinates.

    Type declaration