This is the documentation of version 0.61.0. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias TomTomMapParams

    TomTomMapParams: Partial<GlobalConfig> & {
        events?: MapEventsConfig;
        mapLibre: MapLibreOptions;
        style?: StyleInput;
    }

    Parameters for initializing a TomTom map instance.

    Combines global SDK configuration with map-specific settings like style, events, and MapLibre options. All GlobalConfig properties (key, baseURL, etc.) are optional and will be merged from global configuration. Only mapLibre.container is strictly required.

    Type Declaration

    • Optionalevents?: MapEventsConfig

      How user events are detected and timed, and which cursors they show, for every module. Change it later with TomTomMap.updateEventsConfig.

      events: { paddingBoxPx: 10, longHoverDelayOnStillMapMS: 500, hoverGracePeriodMS: 1000 }
      
    • mapLibre: MapLibreOptions

      MapLibre-specific options for map configuration.

      Includes options for viewport settings, interaction controls, rendering options, and more.

      mapLibre: {
      container: 'map',
      center: [4.9041, 52.3676],
      zoom: 12,
      pitch: 45,
      bearing: -17.6,
      maxZoom: 18,
      minZoom: 8
      }
    • Optionalstyle?: StyleInput

      Map style to load.

      If not specified, defaults to 'standardLight'.

      'standardLight'
      
      // Use dark theme
      style: 'standardDark'

      // Custom configuration
      style: {
      type: 'standard',
      id: 'standardLight',
      include: ['trafficFlow']
      }
    const mapParams: TomTomMapParams = {
    key: 'your-api-key',
    style: 'standardLight',
    events: {
    onClick: (event) => console.log('Map clicked', event)
    },
    mapLibre: {
    container: 'map-container',
    center: [4.9041, 52.3676],
    zoom: 12
    }
    };