TomTom Maps for JavaScript
    Preparing search index...

    Type Alias PlaceLayersConfig

    PlaceLayersConfig: {
        cluster?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
        clusterBadge?: Partial<
            ToBeAddedLayerSpecTemplate<CircleLayerSpecification>,
        >;
        clusterCount?: Partial<
            ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>,
        >;
        clusterMixedBadge?: Partial<
            ToBeAddedLayerSpecTemplate<CircleLayerSpecification>,
        >;
        clusterMixedCount?: Partial<
            ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>,
        >;
        main?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
        micro?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
        selected?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
    } & HasAdditionalLayersConfig

    Configuration for custom place layer styling with MapLibre specifications.

    Type Declaration

    • Optionalcluster?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      Cluster pin layer specification.

      Always registered and stacked above selected, but only renders under the pin-clustered theme and only for single-category clusters — every leaf in the cluster shares the same base-map sprite, picked via a match over the aggregated clusterBaseMapIconIDs property. Mixed-category clusters fall through to clusterMixedBadge + clusterMixedCount instead. For other themes the layer is hidden via layout.visibility = 'none'.

    • OptionalclusterBadge?: Partial<ToBeAddedLayerSpecTemplate<CircleLayerSpecification>>

      Cluster count badge background layer specification.

      Black circle drawn at the top-right of each single-category cluster pin. Acts as the background for clusterCount. Only visible under the pin-clustered theme and gated to single-category clusters; mixed clusters use clusterMixedBadge instead.

    • OptionalclusterCount?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      Cluster count text layer specification.

      White count rendered on top of clusterBadge for single-category clusters. Reads the point_count_abbreviated property MapLibre sets on every cluster feature. Only visible under the pin-clustered theme; mixed clusters use clusterMixedCount instead.

    • OptionalclusterMixedBadge?: Partial<ToBeAddedLayerSpecTemplate<CircleLayerSpecification>>

      Centred count badge for mixed-category clusters under the pin-clustered theme.

      Replaces the cluster icon entirely when a cluster spans multiple POI categories — the count circle takes the centre with clusterMixedCount rendered on top. Filter is an "all clusters with a mixed dedup-concat" check so single-category clusters fall through to cluster + clusterBadge instead.

    • OptionalclusterMixedCount?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      Cluster count text on top of clusterMixedBadge.

      Centred count for mixed-category clusters; mirrors clusterCount but with no translate so it lands inside the centred badge.

    • Optionalmain?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      Main place marker layer specification.

      Controls the visual appearance of all place markers on the map. This layer renders places that are not in a highlighted/selected state.

    • Optionalmicro?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      Micro place marker layer specification.

      Always registered and stacked below the main layer, but only renders features when the base-map theme is active — in that mode it mirrors the map style's POI - Micro layer so place markers blend with the base map's lower-density POI rendering. For other themes the layer is hidden via layout.visibility = 'none' and acts as a no-op, making theme switches cheap (no add/remove layer churn).

    • Optionalselected?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      Selected place marker layer specification.

      Controls the visual appearance of places when they are highlighted or selected (e.g., on hover or click events). This layer is rendered on top of the main layer to ensure selected places are always visible.

      This layer reacts to 'hover' and 'click' event states.

    Provides fine-grained control over place marker layers, allowing customization of both the main place markers and highlighted/selected place markers.

    The layer IDs are derived from the PlacesModule instance prefix plus the key suffix:

    • main: The primary layer for displaying all places
    • selected: The layer for displaying highlighted/clicked places (rendered on top)

    All fields are optional. When a field is not provided, the default styling will be used.

    const config: PlacesModuleConfig = {
    layers: {
    main: {
    layout: {
    'icon-size': 1.2,
    'text-size': 14
    },
    paint: {
    'text-color': '#333'
    }
    },
    selected: {
    layout: {
    'icon-size': 1.5,
    'text-allow-overlap': true
    },
    paint: {
    'text-color': '#3f9cd9'
    }
    }
    }
    };