@magiclane/maps-sdk
    Preparing search index...

    Class RoutingServiceAbstract

    Routing service class

    Index

    Constructors

    Methods

    • Calculate a route between the specified waypoints.

      Parameters

      • waypoints: Landmark[]

        The list of waypoints for the route

      • routePreferences: RoutePreferences

        The preferences for the route calculation

      • onCompleteCallback: (err: GemError, routes: Route[]) => void

        Will be invoked when the search operation is completed, providing the search results and an error code.

        • Will be called with GemError.success error and non-empty routes upon success.
        • Will be called with GemError.notSupported if the provided routing preferences contain an unsupported configuration
        • Will be called with GemError.invalidInput if the calculation input contains invalid data, e.g. waypoints.length < 1 < 2 for path result or waypoints.length < 1 for range result type
        • Will be called with GemError.cancel if the route calculation was canceled by the user
        • Will be called with GemError.waypointAccess if a route couldn't be found using the provided routing preferences
        • Will be called with GemError.connectionRequired if the routing preferences RoutePreferences.allowOnlineCalculation = false and the calculation cannot be done on client side due to missing necessary data
        • Will be called with GemError.expired if the calculation cannot be done on client side due to missing necessary data and the client world map data version is no longer supported by the online routing service
        • Will be called with GemError.routeTooLong if the routing was executed on the online service and the operation took too much time to complete (usually more than 1 min, depending on the server overload state)
        • Will be called with GemError.invalidated if the offline map data changed (offline map downloaded, erased, updated) during the calculation
        • Will be called with GemError.noMemory if the routing engine couldn't allocate the necessary memory for the calculation

      Returns TaskHandler | null

      The TaskHandler associated with the route calculation if it can be started otherwise null.

      An exception if it fails.

    • Cancel the route calculation associated with the specified listener.

      Parameters

      • taskHandler: TaskHandler

        The listener associated with the route calculation to be canceled.

      Returns void

      An exception if it fails.

    • Get the status for the route monitored by the given task handler.

      Parameters

      • taskHandler: TaskHandler

        The task handler associated with the route calculation to be canceled.

      Returns RouteStatus

      The status of the route calculation.

      An exception if it fails.

    • Check if there is route calculation in progress associated with the specified task handler.

      Parameters

      • taskHandler: TaskHandler

        The task handler associated with the route calculation to be canceled.

      Returns boolean

      true if the route calculation is in progress, false otherwise.

      An exception if it fails.

    • Reset the user road blocks.

      This will remove all the user road blocks set by the user.

      Returns void

      An exception if it fails.

    • Set a user road block from the provided route instruction.

      Parameters

      Returns GemError

      0 on success, otherwise see GemError for other values.

      An exception if it fails.