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

      Event handler configuration for map interactions.

      Define callbacks for various map events like clicks, hovers, and movements.

      events: {
      onClick: (event) => {
      console.log('Clicked at', event.lngLat);
      },
      onMoveEnd: () => {
      console.log('Map moved to', map.getCenter());
      }
      }
    • 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,
      antialias: true,
      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
    }
    };