ConstUse this array when you need to:
The array is defined as const with as const assertion to ensure type safety
and 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 => {
return standardStyleIDs.includes(id as any);
};
StandardStyleID - The type derived from this array
Array of all available standard style identifiers.
This constant provides the complete list of TomTom-hosted standard map styles that can be used when initializing a map. It serves as the source of truth for valid style IDs and is used to derive the StandardStyleID type.