ConstUse this array to:
The array is declared as const, so the compiler treats it as read-only. Nothing freezes it at runtime.
import { standardStyleIDs } from '@tomtom-org/maps-sdk/map';
// Build a dropdown menu with all standard styles
const styleSelector = document.querySelector<HTMLSelectElement>('#style-selector');
standardStyleIDs.forEach((styleId) => {
styleSelector?.add(new Option(styleId));
});
// Check if a style ID is valid
const isValidStyle = (id: string): boolean => standardStyleIDs.some((styleId) => styleId === id);
StandardStyleID - The type derived from this array
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.