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...

    Variable standardStyleIDsConst

    standardStyleIDs: readonly [
        "streetLight",
        "streetDark",
        "streetLightDriving",
        "streetDarkDriving",
        "monoLight",
        "monoDark",
        "streetSatellite",
    ] = ...

    Every standard style ID.

    The TomTom-hosted standard map styles you can initialize a map with. This array is the source of truth for valid style IDs, and the StandardStyleID type derives from it.

    Use this array to:

    • Iterate over all available styles (e.g., building a style picker UI)
    • Validate if a style ID is a standard style
    • Display available options to users

    The array is declared with const and an as const assertion, for type safety and to prevent modifications at runtime.

    import { standardStyleIDs } from '@tomtom-org/maps-sdk/map';

    // Build a dropdown menu with all standard styles
    const styleSelector = document.getElementById('style-selector');
    standardStyleIDs.forEach((styleId) => {
    const option = new Option(styleId);
    styleSelector.add(option);
    });

    // Check if a style ID is valid
    const isValidStyle = (id: string): boolean => standardStyleIDs.some((styleId) => styleId === id);

    StandardStyleID - The type derived from this array