MapLayr
    Preparing search index...

    Interface PositionProvider

    An interface for objects that provide a position.

    This interface allows objects to provide a position that can change over time, with subscribers being notified of changes.

    interface PositionProvider {
        currentPosition: Position | null;
        subscribeToPosition(
            callback: (position: Position | null) => void,
        ): () => void;
    }

    Implemented by

    Index

    Properties

    currentPosition: Position | null

    The current position.

    A null value indicates that the position is not available.

    Methods

    • Subscribes to position updates.

      Parameters

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

        The callback to call when the position changes.

      Returns () => void

      A function to unsubscribe from the position updates.

      The callback function is not called until the position provider produces a new position: use currentPosition to get the current position.