MapLayr
    Preparing search index...

    Class ReactiveRoute

    A reactive route that automatically updates when the origin position changes.

    This class manages route calculation and provides notifications when the route changes. Multiple shapes can subscribe to the same reactive route to share calculation results.

    The route only subscribes to position updates when there are active subscribers, automatically cleaning up when no longer needed.

    Implements

    Index

    Accessors

    • get currentRoute(): Route | null

      The current route, or null if no route is available.

      Returns Route | null

    Methods

    • Subscribe to path updates (PathProvider implementation).

      Parameters

      • callback: (path: Path | null) => void

        Called when the path changes

      Returns () => void

      Unsubscribe function

    • Subscribe to route updates.

      Parameters

      • callback: (route: Route | null) => void

        Called when the route changes

      Returns () => void

      Unsubscribe function