ClassGeolocationPositionProvider

A position provider that uses the browser's Geolocation API to provide the user's current location.

Implements

Constructors

Accessors

Methods

Constructors

  • Creates a new geolocation position provider.

    Parameters

    • options: PositionOptions = ...

      Options for the geolocation API. Defaults to high accuracy with a 10-second timeout.

    Returns GeolocationPositionProvider

Accessors

Methods

  • Subscribes to position updates from the geolocation API.

    Parameters

    • callback: ((position: null | Position) => void)

      The callback to call when the position changes.

        • (position): void
        • Parameters

          Returns void

    Returns (() => void)

    A function to unsubscribe from the position updates.

      • (): void
      • Returns void