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

    Type Alias CountryCrossingConfig

    Appearance of the border crossings along a route.

    A crossing is the seam between two consecutive country sections, so it is a point rather than a stretch, and takes knobs of its own instead of a place in the section catalogue. Each is a plaque naming both countries by their ISO 3166-1 alpha-2 codes in the direction of travel, 'ES → FR'.

    The plaque follows the map's light/dark theme unless color or textColor says otherwise, so it stays legible across a style change without being reconfigured.

    const routes = await calculateRoute({ locations, sectionTypes: ['country'] });
    await routing.showRoutes(routes);
    type CountryCrossingConfig = {
        alignment?: CountryCrossingAlignment;
        color?: string;
        minZoom?: number;
        textColor?: string;
        visible?: boolean;
    }
    Index

    How the plaque is turned on the map.

    'viewport'

    color?: string

    The plaque colour behind the label.

    the SDK's near-black '#1A2024' on a light map, and the near-white '#F1F3F5' on a dark one.

    minZoom?: number

    The lowest zoom a crossing is drawn at.

    4, low enough for a continental route to show its borders while framed whole.
    
    textColor?: string

    The label colour.

    whichever of the SDK's near-black and near-white reads on the plaque, so setting color alone stays legible.

    visible?: boolean

    Whether the crossings are drawn.

    true