Interface RouteApiInterface

Route API object that encapsulates all classes and methods that contain all classes and methods needed to work with routing.

interface RouteApiInterface {
    onRouteChanged: Signal<RouteChangeHandler>;
    onRouteInstructionClick: Signal<RouteInstructionMouseClickHandler>;
    onRouteInstructionMouseOut: Signal<RouteInstructionMouseOutHandler>;
    onRouteInstructionMouseOver: Signal<RouteInstructionMouseOverHandler>;
    clear(): void;
    getRoute(source: Vector3, destination: Vector3): Promise<RouteDataInterface>;
    route(source: Vector3 | PoiInterface, destination: Vector3 | PoiInterface, moveToStart?: boolean): Promise<RouteDataInterface>;
}

Properties

onRouteChanged: Signal<RouteChangeHandler>

Signal that is emitted when there is a change in the route.

onRouteInstructionClick: Signal<RouteInstructionMouseClickHandler>

Signal that is emitted when the user clicks on a route instruction.

onRouteInstructionMouseOut: Signal<RouteInstructionMouseOutHandler>

Signal that is emitted when the mouse has moved out of a route instruction.

onRouteInstructionMouseOver: Signal<RouteInstructionMouseOverHandler>

Signal that is emitted when the mouse is moved over a route instruction.

Methods

  • Clear the current route and resets all associated user interface elements.

    Returns void

  • Find a route between the source and the destination. Note: This method will only return the route and will not update any views.

    Parameters

    • source: Vector3

      A location in site coordinates.

    • destination: Vector3

      A location in site coordinates.

    Returns Promise<RouteDataInterface>

    A promise which returns the route. In case there is no route found between the source and destination, the promise will be rejected with the specific reason for the rejection.

  • Find a route between the source and the destination. This will also open the user interface elements associated with the route.

    Parameters

    • source: Vector3 | PoiInterface

      The starting point of the route. If a Vector3 location is specified, it should be in site coordinates.

    • destination: Vector3 | PoiInterface

      The ending point of the route. If a Vector3 location is specified, it should be in site coordinates.

    • OptionalmoveToStart: boolean

      A boolean specifying whether to move to start or not. If not provided this parameter will default to true.

    Returns Promise<RouteDataInterface>

    A promise which returns the route. In case there is no route found between the source and destination, the promise will be rejected with the specific reason for the rejection.