Implements functions to convert distances and times to strings, as well as converting an IInstruction to a string. Override or implement your own if you need to customize formatting.

Hierarchy

Constructors

Properties

Methods

  • Parameters

    • s: string

    Returns string

  • Formats a distance given in meters to a string with the given (or suitable if not provided) precision and unit

    Parameters

    • distance: number
    • sensitivity: number = 0

    Returns string

  • Formats an instruction to a human readable text

    Parameters

    Returns string

  • Formats a time duration, given in seconds, to a string with suitable precision and unit

    Parameters

    • time: number

    Returns string

  • Returns an icon name depending on the instruction type or modifier If it's a simple text instruction, no icon is returned by default

    Parameters

    Returns undefined | "" | "depart" | "arrive" | "via" | "enter-roundabout" | "continue" | "bear-right" | "turn-right" | "sharp-right" | "u-turn" | "sharp-left" | "turn-left" | "bear-left"

  • Parameters

    • distance: number
    • Optional sensitivity: number

    Returns number

Generated using TypeDoc