Mappedin JS - v6.14.0
    Preparing search index...

    Type Alias TGetDirectionsOptions

    Options for controlling the behavior of the Directions.

    type TGetDirectionsOptions = {
        accessible?: boolean;
        connectionIdWeightMap?: Record<string, number>;
        excludedConnections?: Connection[];
        smoothing?:
            | boolean
            | {
                __EXPERIMENTAL_METHOD?: "greedy-los";
                enabled?: boolean;
                radius?: number;
            }
            | {
                __EXPERIMENTAL_METHOD: "rdp";
                __EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES?: boolean;
                enabled?: boolean;
                radius?: number;
            }
            | {
                __EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES?: boolean;
                __EXPERIMENTAL_METHOD: "dp-optimal";
                enabled?: boolean;
                radius?: number;
            };
        zones?: TDirectionZone[];
    }
    Index

    Properties

    accessible?: boolean

    If true directions will only take accessible routes

    false
    
    connectionIdWeightMap?: Record<string, number>

    Override the default weights for specific connection ids.

    excludedConnections?: Connection[]

    Enterprise only. Connections that should not be used for directions.

    If a connection is excluded, it will not be used in the directions even if it is the shortest (or only) path. If there is no path that does not include the these connections, the directions will be undefined.

    smoothing?:
        | boolean
        | {
            __EXPERIMENTAL_METHOD?: "greedy-los";
            enabled?: boolean;
            radius?: number;
        }
        | {
            __EXPERIMENTAL_METHOD: "rdp";
            __EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES?: boolean;
            enabled?: boolean;
            radius?: number;
        }
        | {
            __EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES?: boolean;
            __EXPERIMENTAL_METHOD: "dp-optimal";
            enabled?: boolean;
            radius?: number;
        }

    Enable or disable path smoothing for directions. When enabled, the path is simplified using line-of-sight checks to provide a more visually appealing route and shorter instructions.

    Can be a boolean to enable or disable smoothing, or an object with configuration options.

    Available methods:

    • 'greedy-los' (default): Greedy forward scan with line-of-sight validation. Fastest, O(n) time complexity. Good default choice.
    • 'rdp': Uses Ramer-Douglas-Peucker preprocessing + line-of-sight validation + door buffer nodes. Better for paths with doors and complex geometry. Medium speed.
    • 'dp-optimal': Dynamic Programming for globally optimal simplification. Slowest but highest quality, O(n²) complexity. Best when path quality is critical.

    Type Declaration

    • boolean
    • { __EXPERIMENTAL_METHOD?: "greedy-los"; enabled?: boolean; radius?: number }
      • Optional Experimental__EXPERIMENTAL_METHOD?: "greedy-los"

        Path smoothing method using greedy line-of-sight algorithm. Fastest method with O(n) time complexity. Good default choice.

        'greedy-los'
        
      • Optionalenabled?: boolean

        Enable or disable path smoothing.

        true for non-enterprise mode, false for enterprise mode
        
      • Optionalradius?: number

        The radius of the buffer around the path to consider when simplifying, in meters.

        0.75
        
    • {
          __EXPERIMENTAL_METHOD: "rdp";
          __EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES?: boolean;
          enabled?: boolean;
          radius?: number;
      }
      • Experimental__EXPERIMENTAL_METHOD: "rdp"

        Path smoothing method using Ramer-Douglas-Peucker preprocessing with line-of-sight validation. Better for paths with doors and complex geometry. Medium speed. Always uses line-of-sight validation (cannot be disabled).

      • Optional Experimental__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES?: boolean

        Whether to include door-adjacent nodes (predecessor/successor of doors) in the must-include set. When true (default), nodes immediately before and after doors are preserved during simplification.

        true
        
      • Optionalenabled?: boolean

        Enable or disable path smoothing.

        true for non-enterprise mode, false for enterprise mode
        
      • Optionalradius?: number

        The radius of the buffer around the path to consider when simplifying, in meters.

        0.75
        
    • {
          __EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES?: boolean;
          __EXPERIMENTAL_METHOD: "dp-optimal";
          enabled?: boolean;
          radius?: number;
      }
      • Optional Experimental__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES?: boolean

        Whether to include 0.5m buffer nodes perpendicular to doors in DP simplification. When true, predecessor and successor nodes of doors are marked with preventSmoothing.

        false
        
      • Experimental__EXPERIMENTAL_METHOD: "dp-optimal"

        Path smoothing method using Dynamic Programming for globally optimal simplification. Slowest but highest quality, O(n²) complexity. Best when path quality is critical.

      • Optionalenabled?: boolean

        Enable or disable path smoothing.

        true for non-enterprise mode, false for enterprise mode
        
      • Optionalradius?: number

        The radius of the buffer around the path to consider when simplifying, in meters.

        0.75
        
    true for non-enterprise mode, false for enterprise mode
    
    // Enable smoothing with default settings
    mapView.getDirections(firstSpace, secondSpace, {
    smoothing: true
    })

    // Enable smoothing with custom radius (in meters)
    mapView.getDirections(firstSpace, secondSpace, {
    smoothing: {
    radius: 1.5,
    }
    })

    // Use greedy line-of-sight method (default, explicit)
    mapView.getDirections(firstSpace, secondSpace, {
    smoothing: {
    enabled: true,
    __EXPERIMENTAL_METHOD: 'greedy-los',
    radius: 0.4,
    }
    })

    // Use RDP method (always uses line-of-sight)
    mapView.getDirections(firstSpace, secondSpace, {
    smoothing: {
    enabled: true,
    __EXPERIMENTAL_METHOD: 'rdp',
    radius: 0.4,
    }
    })

    // Use DP-optimal method with door buffer nodes
    mapView.getDirections(firstSpace, secondSpace, {
    smoothing: {
    enabled: true,
    __EXPERIMENTAL_METHOD: 'dp-optimal',
    __EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES: true,
    radius: 0.4,
    }
    })
    zones?: TDirectionZone[]

    Defines the special zones for navigation operations.

    mapView.getDirections(firstSpace, secondSpace, {
    zones: [
    {
    geometry: polygon as Feature<Polygon>,
    // The additional cost for navigation through the zone, from 0 to Infinity.
    // The final cost is calculated as the sum of basic cost that comes from the {@MapData}
    // and the additional zone cost.
    // A additional cost of 0 will make the zone free to navigate through
    // A additional cost of Infinity will make the zone impossible to navigate through
    cost: Infinity,
    floor: mapView.currentFloor,
    },
    ],
    });