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

    Type Alias WaypointIconConfig

    The waypoint pins, one per role (origin, stops, destination), each in the SDK's pin or an image of your own, plus an optional icon per waypoint picked from its data.

    A pin's style is laid over, in order: the route colour as its fill, style, and the role's own style. A role's image replaces its pin, and mapping replaces the role's icon for the waypoints it returns an id or category for.

    const icon: WaypointIconConfig = {
    style: { outlineColor: '#FFFFFF' },
    start: { style: { fillColor: '#1B7A43' } },
    finish: { image: { image: '/flag.svg', pixelRatio: 2 } },
    // Stops that are charging stations look like the map's charging stations:
    mapping: { to: 'poiCategory', fn: (waypoint) => waypoint.properties.poi?.categories?.[0] },
    };
    type WaypointIconConfig = {
        customIcons?: CustomImage[];
        finish?: PinIconConfig;
        mapping?: IconMapping<DisplayWaypoint>;
        middle?: PinIconConfig;
        start?: PinIconConfig;
        style?: SVGIconStyleOptions;
    }
    Index
    customIcons?: CustomImage[]

    Images for mapping to pick by id.

    Each is added under its own id, so mapping returns that id. An entry's offsetX/offsetY shift that icon from the waypoint's position, and apply only to an entry with an image. An entry naming a sprite icon by id alone ignores them.

    finish?: PinIconConfig

    The destination's pin.

    The icon of each waypoint, picked from its data.

    fn receives the waypoint as drawn, with its own properties plus its indexType role and the role's iconID. If it returns undefined, the role's pin stays. A poiCategory draws the pin PlacesModule draws for that category. A mapped icon carries no stop mark.

    middle?: PinIconConfig

    The pin of every stop between origin and destination.

    The origin's pin.

    Style of all three pins, under each role's own style.