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

    Type Alias PlacesClusterConfig

    Configuration for the pin-clustered marker type.

    Ignored by every other PlacesMarkerType.

    const places = await PlacesModule.create(map, {
    markerType: 'pin-clustered',
    cluster: {
    badge: { color: '#3f9cd9', radius: { single: 13, mixed: 18 } }
    }
    });
    type PlacesClusterConfig = {
        badge?: PlaceClusterBadgeConfig;
        source?: PlacesClusterSourceConfig;
    }
    Index

    Appearance of the cluster count badge.

    How places group into clusters, set on the underlying GeoJSON source.

    • Changing them with PlacesModule.applyConfig recreates the places source.
    • Clustering itself is not settable, since markerType: 'pin-clustered' switches it on.
    const places = await PlacesModule.create(map, {
    markerType: 'pin-clustered',
    cluster: {
    source: {
    radius: 100,
    maxZoom: 14,
    minPoints: 3,
    // Total charging points across the cluster
    properties: { connectors: ['+', ['get', 'connectorCount']] }
    },
    },
    layers: {
    clusterCount: { layout: { 'text-field': ['get', 'connectors'] } }
    }
    });