This is the documentation of version 1.0.0-rc.2. Go to the latest version, 1.0.0-rc.5.
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

    MapLibre specifications for custom place layer styling.

    Type Declaration

    • Optionalcluster?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      The cluster pin layer specification.

      It is always registered and stacked above selected, but renders only under the pin-clustered marker type, and only for single-category clusters. In those, every leaf shares the same base-map sprite, which a match over the aggregated clusterBaseMapIconIDs property picks. Mixed-category clusters use clusterMixedBadge and clusterMixedCount instead. Other marker types hide the layer with layout.visibility = 'none'.

    • OptionalclusterBadge?: Partial<ToBeAddedLayerSpecTemplate<CircleLayerSpecification>>

      The cluster count badge background layer specification.

      A circle drawn at the top-right of each single-category cluster pin, as the background for clusterCount. It is visible only under the pin-clustered marker type, and only for single-category clusters. Mixed clusters use clusterMixedBadge instead.

    • OptionalclusterCount?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      The cluster count text layer specification.

      The count rendered on top of clusterBadge for single-category clusters. It reads the point_count_abbreviated property MapLibre sets on every cluster feature. It is visible only under the pin-clustered marker type. Mixed clusters use clusterMixedCount instead.

    • OptionalclusterMixedBadge?: Partial<ToBeAddedLayerSpecTemplate<CircleLayerSpecification>>

      The centred count badge for mixed-category clusters under the pin-clustered marker type.

      It replaces the cluster icon entirely when a cluster spans multiple POI categories. The count circle takes the centre, with clusterMixedCount rendered on top. Its filter checks for "all clusters with a mixed dedup-concat", so single-category clusters use cluster and clusterBadge instead.

    • OptionalclusterMixedCount?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      The cluster count text on top of clusterMixedBadge.

      The centred count for mixed-category clusters. It mirrors clusterCount but has no translate, so it lands inside the centred badge.

    • Optionalmain?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      The main place marker layer specification.

      It sets the look of all place markers on the map, and renders places that are not highlighted or selected.

    • Optionalmicro?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      The micro place marker layer specification.

      It is always registered and stacked below the main layer, but renders features only under the base-map marker type. There, it mirrors the map style's POI - Micro layer, so place markers blend with the base map's lower-density POI rendering. Other marker types hide it with layout.visibility = 'none', which makes it a no-op and marker type switches cheap, without adding or removing layers.

    • Optionalselected?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>

      The selected place marker layer specification.

      It sets the look of places when they are highlighted or selected, such as on hover or click. It renders on top of the main layer, so selected places are always visible.

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

    They give fine-grained control over the place marker layers, both the main place markers and the highlighted or selected ones.

    Each layer ID is the PlacesModule instance prefix plus the key suffix:

    • main - The primary layer, which displays all places.
    • selected - The layer for highlighted or clicked places, rendered on top.

    All fields are optional. A field you leave out keeps the default styling.

    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'
    }
    }
    }
    };