TomTom Maps for JavaScript
    Preparing search index...

    Type Alias MapFont

    MapFont: typeof mapFonts[number]

    Type representing valid font faces available in the TomTom map style.

    Use this type to ensure type-safe font selection when working with text layers. Restricts values to only the fonts available in the map style.

    import type { MapFont } from '@tomtom-international/maps-sdk-js/map';

    function createTextLayer(font: MapFont) {
    return {
    type: 'symbol',
    layout: {
    'text-font': [font],
    'text-field': ['get', 'name']
    }
    };
    }

    // Type-safe: only accepts valid map fonts
    const layer = createTextLayer('Noto-Bold');