TomTom Maps for JavaScript
    Preparing search index...

    Type Alias CustomStyle

    Configuration for a custom map style.

    Allows using your own map style either via URL or direct JSON specification.

    Use custom styles for:

    • Branded map appearances
    • Specialized use cases (indoor maps, thematic maps)
    • Integration with custom tile servers
    // Load from URL
    const urlStyle: CustomStyle = {
    url: 'https://example.com/my-custom-style.json'
    };

    // Direct JSON specification
    const jsonStyle: CustomStyle = {
    json: {
    version: 8,
    sources: { ... },
    layers: [ ... ]
    }
    };
    type CustomStyle = {
        json?: StyleSpecification;
        url?: string;
    }
    Index

    Properties

    Properties

    json?: StyleSpecification

    Direct style specification as JSON.

    Provide the complete MapLibre Style Specification object. Mutually exclusive with the url property.

    json: {
    version: 8,
    sources: {
    'my-source': { type: 'vector', url: '...' }
    },
    layers: [
    { id: 'background', type: 'background', paint: { 'background-color': '#f0f0f0' } }
    ]
    }
    url?: string

    URL to a MapLibre/Mapbox style JSON.

    The URL should not include the API key - it will be automatically added. Mutually exclusive with the json property.

    url: 'https://api.tomtom.com/style/1/style/my-custom-style'