Map styles

Map Styles in the TomTom Maps SDK define the visual appearance and data presentation of maps. This guide covers TomTom’s built-in styles, style components, and customization options.

A map style consists of various layers and sources that determine how geographic features are rendered.

The SDK provides several pre-defined styles optimized for different use cases, along with the ability to customize styles by including additional layers or modifying existing ones.

import { TomTomConfig } from '@tomtom-org/maps-sdk/core';
import { type StandardStyleID, standardStyleIDs, TomTomMap } from '@tomtom-org/maps-sdk/map';
import './style.css';
import { API_KEY } from './config';

TomTomConfig.instance.put({ apiKey: API_KEY, language: 'en-GB' });

const map = new TomTomMap({
    mapLibre: {
        container: 'sdk-map',
        zoom: 14,
        center: [-0.12621, 51.50394],
    },
});

const stylesSelector = document.querySelector('#sdk-example-mapStyles') as HTMLSelectElement;
standardStyleIDs.forEach((id) => stylesSelector.add(new Option(id)));
stylesSelector.addEventListener('change', (event) =>
    map.setStyle((event.target as HTMLOptionElement).value as StandardStyleID),
);

Built-in Styles

Basic Styles

import { TomTomMap } from '@tomtom-org/maps-sdk/map';
// Light theme (default)
const map = new TomTomMap({
mapLibre: {
container: 'map'
},
style: 'monoLight'
});
// Dark theme
const map = new TomTomMap({
mapLibre: {
container: 'map'
},
style: 'monoDark'
});
// Satellite imagery with roads
const map = new TomTomMap({
mapLibre: {
container: 'map'
},
style: 'hybrid'
});
// Pure satellite imagery
const map = new TomTomMap({
mapLibre: {
container: 'map'
},
style: 'satellite'
});

Dynamic Style Switching

const map = new TomTomMap({ mapLibre: { container: 'map' } });
// Change style after map creation
map.setStyle('monoDark');
// ...
map.setStyle('drivingLight');

Available Style Parts

The map style includes multiple parts that come from different data sources:

  • Base Map and POIs: Core geographic features and points of interest.
  • Traffic Incidents: Real-time traffic incident data.
    • Included in the style by default, but hidden upfront.
    • Can be optionally excluded from the style for performance.
    • Controlled by TrafficIncidentsModule .
  • Traffic Flow: Live traffic flow information.
    • Included in the style by default, but hidden upfront.
    • Can be optionally excluded from the style for performance.
    • Controlled by TrafficFlowModule .
  • Hillshade: Terrain elevation shading for enhanced topography.
    • Included in the style by default, but hidden upfront.
    • Can be optionally excluded from the style for performance.
    • Controlled by HillshadeModule .
// Common layer modules you can include or not:
include: [
'trafficIncidents', // Traffic incidents
'trafficFlow', // Traffic flow data
'hillshade' // Terrain shading
]

Map Language

const map = new TomTomMap({
mapLibre: {
container: 'map'
},
style: 'monoLight',
language: 'de-DE' // German labels
});
);

Core Map Setup

Advanced Features

Practical Examples

Integration and Customization