ConstUse this array to:
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
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.