TomTom Maps for JavaScript
    Preparing search index...

    Type Alias PlaceConnectionDisplay

    Describes a single connection between two places, to be rendered as a line on the map.

    Each endpoint can be given either as a full Place object or as the id of a place that is currently displayed by the PlacesModule (via show()). When an id is given, the module resolves it against its currently shown places to obtain the coordinates; connections referencing unknown ids are silently skipped.

    Extra arbitrary properties are preserved on the connection and passed to the optional label function, making it easy to render metadata such as distance or travel time along the line.

    const connection: PlaceConnectionDisplay = {
    from: stationPlace, // full Place object
    to: 'cafe-id-123', // or a shown place's id
    distanceMeters: 420 // extra metadata available to the label function
    };
    type PlaceConnectionDisplay = {
        from: Place | string;
        id?: string;
        to: Place | string;
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown

      Arbitrary extra metadata, preserved on the connection and passed to the label function.

    Index

    Properties

    Properties

    from: Place | string

    The first endpoint of the connection. Either a Place object or the id of a place currently shown by the module.

    id?: string

    Optional stable id for this connection. When omitted, an id is generated.

    to: Place | string

    The second endpoint of the connection. Either a Place object or the id of a place currently shown by the module.