Home > @magiclane/maps-sdk > GemMap > expandCluster

GemMap.expandCluster() method

Expand the marker cluster (points group) under position (PHYSICAL pixels — same convention as registerTouchCallback).

Two-mode expansion: when zooming in would visually separate the members, the camera animates to exactly that zoom, centered on the cluster. Otherwise — members within one pin-footprint or fully coincident — the members fan out in screen space around the cluster anchor (spiderfy), at most maxLeaves at a time with a "+N" paging leaf for the rest.

Requires the collection to be added with buildPointsGroupConfig: true (the engine's points-group queries back this API).

Signature:

expandCluster(position: Point, options?: {
        onLeafTap?: (marker: Marker) => void;
        maxLeaves?: number;
    }): Promise<boolean>;

Parameters

Parameter

Type

Description

position

Point

Physical-pixel screen position of the cluster.

options

{ onLeafTap?: (marker: Marker) => void; maxLeaves?: number; }

(Optional)

options properties:

  • Optional onLeafTap?: (marker: Marker) => void

    Fired when the user taps a fanned-out

  • Optional maxLeaves?: number

    Fan at most this many leaves (default 24).

Returns:

Promise<boolean>

false when no expandable cluster is under the point.