getClusterExpansionZoom method

Future<int> getClusterExpansionZoom(
  1. String sourceId,
  2. int clusterId
)

Reads the zoom level at which a cluster of a clustered GeoJSON source splits.

clusterId is the "cluster_id" property of a cluster feature. At the result's zoom level, the cluster splits into two or more clusters or points.

A cluster ID can go out of date as RenderSessionHandle.getClusterChildren() describes.

See mln_render_session_get_cluster_expansion_zoom in the C API reference.

Errors:

  • Status.notFound when the session's most recent render attempt had no source named sourceId, or the source has no cluster clusterId.
  • Status.invalidArgument when the source isn't a GeoJSON source with clustering turned on.

Implementation

Future<int> getClusterExpansionZoom(String sourceId, int clusterId) => _query(
  _resultint,
  (arena, completion) => raw.mln_render_session_get_cluster_expansion_zoom(
    _handle.raw,
    nativeStringView(sourceId, arena).value,
    _nativeInteger(clusterId, 0, 4294967295),
    completion,
    nativeDiagnostic,
  ),
);