This is the documentation of version 0.62.0. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias PlaceConnectionsConfig

    Configuration for rendering connection lines between places.

    Controls the appearance of connection lines, the optional label drawn along each line, and MapLibre layer overrides.

    const config: PlacesModuleConfig = {
    connections: {
    label: (connection) => `${connection.distanceMeters} m`,
    layers: {
    line: { paint: { 'line-color': '#3f9cd9' } }
    }
    }
    };
    type PlaceConnectionsConfig = {
        color?: string;
        haloColor?: string;
        label?: (connection: PlaceConnectionDisplay) => string;
        layers?: PlaceConnectionsLayersConfig;
        textColor?: string;
    }
    Index
    color?: string

    Colour of the connection lines, over the module's PlacesModuleConfig.color. Unset, they take that colour, else the map's accent, else a blue that follows the light/dark theme.

    haloColor?: string

    Colour of the halo around the labels. Unset: '#FFFFFF' on a light map, '#333333' on a dark one, as for the places' own labels.

    label?: (connection: PlaceConnectionDisplay) => string

    Function returning the text to display along the connection line.

    Receives the original PlaceConnectionDisplay (including any custom metadata). When omitted, no label is rendered.

    Custom MapLibre layer specifications for connection line and label.

    textColor?: string

    Colour of the labels along the lines. Unset: a darker shade of the line colour on a light map, a lighter one on a dark map.