### Install Dependencies Source: https://www.npmjs.com/package/supercluster?activeTab=dependencies Install project dependencies using npm. ```bash npm install # install dependencies ``` -------------------------------- ### Configure Map/Reduce for Property Aggregation Source: https://www.npmjs.com/package/supercluster?activeTab=readme Example of setting up 'map' and 'reduce' options to aggregate a 'sum' property from input points. ```javascript const index = new Supercluster({ map: (props) => ({sum: props.myValue}), reduce: (accumulated, props) => { accumulated.sum += props.sum; } }); ``` -------------------------------- ### Install TypeScript Definitions Source: https://www.npmjs.com/package/supercluster?activeTab=readme Install the TypeScript type definitions for Supercluster using npm. ```bash npm install @types/supercluster --save-dev ``` -------------------------------- ### Install Supercluster via npm Source: https://www.npmjs.com/package/supercluster?activeTab=readme Install the Supercluster package using npm. ```bash npm i supercluster ``` -------------------------------- ### Develop Supercluster: Install Dependencies Source: https://www.npmjs.com/package/supercluster?activeTab=dependents Install project dependencies for developing Supercluster. ```bash npm install ``` -------------------------------- ### Initialize and Cluster Points Source: https://www.npmjs.com/package/supercluster?activeTab=readme Initialize Supercluster with custom radius and max zoom, load points, and get clusters for a given bounding box and zoom level. ```javascript const index = new Supercluster({radius: 40, maxZoom: 16}); index.load(points); const clusters = index.getClusters([-180, -85, 180, 85], 2); ``` -------------------------------- ### Supercluster Initialization and Usage Source: https://www.npmjs.com/package/supercluster?activeTab=versions Demonstrates how to initialize Supercluster with options, load points, and retrieve clusters within a bounding box. ```APIDOC ## Initialization and Basic Usage ### Description Initialize Supercluster with custom options, load an array of GeoJSON Feature objects, and then retrieve clustered points for a given bounding box and zoom level. ### Method Constructor and instance methods ### Endpoint N/A (Client-side library) ### Parameters #### Constructor Options - **radius** (number) - Optional - Cluster radius, in pixels. Default: 40. - **maxZoom** (number) - Optional - Maximum zoom level at which clusters are generated. Default: 16. - **minZoom** (number) - Optional - Minimum zoom level at which clusters are generated. Default: 0. - **minPoints** (number) - Optional - Minimum number of points to form a cluster. Default: 2. - **extent** (number) - Optional - Tile extent. Radius is calculated relative to this value. Default: 512. - **nodeSize** (number) - Optional - Size of the KD-tree leaf node. Affects performance. Default: 64. - **log** (boolean) - Optional - Whether timing info should be logged. Default: false. - **generateId** (boolean) - Optional - Whether to generate ids for input features in vector tiles. Default: false. - **map** (function) - Optional - Function that returns cluster properties corresponding to a single point. - **reduce** (function) - Optional - Reduce function that merges properties of two clusters into one. #### `load(points)` Parameters - **points** (Array) - Required - An array of GeoJSON Feature objects. Each feature's `geometry` must be a GeoJSON Point. #### `getClusters(bbox, zoom)` Parameters - **bbox** (Array) - Required - Bounding box array in the format `[westLng, southLat, eastLng, northLat]`. - **zoom** (number) - Required - Integer zoom level. ### Request Example ```javascript const index = new Supercluster({ radius: 40, maxZoom: 16, map: (props) => ({ sum: props.myValue }), reduce: (accumulated, props) => { accumulated.sum += props.sum; } }); const points = [ { type: 'Feature', geometry: { type: 'Point', coordinates: [-122.4194, 37.7749] }, properties: { myValue: 10 } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-122.4195, 37.7750] }, properties: { myValue: 20 } } ]; index.load(points); const clusters = index.getClusters([-180, -85, 180, 85], 2); ``` ### Response #### Success Response (200) - **clusters** (Array) - An array of GeoJSON Feature objects representing clusters and individual points. #### Response Example ```json [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122.41945, 37.77495] }, "properties": { "cluster": true, "cluster_id": 0, "point_count": 2, "sum": 30 } } ] ``` ``` -------------------------------- ### Run Tests Source: https://www.npmjs.com/package/supercluster?activeTab=dependencies Execute the test suite for Supercluster using npm. ```bash npm test # run tests ``` -------------------------------- ### Run Tests Source: https://www.npmjs.com/package/supercluster?activeTab=readme Execute the test suite for Supercluster. ```bash npm test # run tests ``` -------------------------------- ### Supercluster Options Source: https://www.npmjs.com/package/supercluster Detailed explanation of the configuration options available when initializing Supercluster. ```APIDOC ## Supercluster Options ### Description This section describes the various options that can be configured when initializing the Supercluster index to customize its behavior. ### Core Options | Option | Default | Description | |---------------|---------|-----------------------------------------------------------------------------| | **minZoom** | 0 | Minimum zoom level at which clusters are generated. | | **maxZoom** | 16 | Maximum zoom level at which clusters are generated. | | **minPoints** | 2 | Minimum number of points required to form a cluster. | | **radius** | 40 | Cluster radius in pixels. | | **extent** | 512 | (For tiles) Tile extent. Radius is calculated relative to this value. | | **nodeSize** | 64 | Size of the KD-tree leaf node. Affects performance. | | **log** | false | If true, timing information will be logged to the console. | | **generateId**| false | If true, generates unique IDs for input features when creating vector tiles. | ### Property Map/Reduce Options Supercluster supports aggregating properties from points into clusters using `map` and `reduce` functions. - **map**: A function that takes the properties of a single point and returns the properties to be associated with that point within a cluster. This function must return a new object. ```javascript map: (props) => ({ sum: props.myValue }) ``` - **reduce**: A function that merges the properties of two clusters (or a point and a cluster) into a single cluster's properties. This function must not mutate its arguments. ```javascript reduce: (accumulated, props) => { accumulated.sum += props.sum; } ``` **Conditions for `map` and `reduce`:** - `map` must return a new object, not modify the original `properties` of a point. - `reduce` must not mutate the second argument (`props`). ### Example Usage of Map/Reduce ```javascript const index = new Supercluster({ map: (props) => ({ pointCount: 1, totalValue: props.value }), reduce: (accumulated, props) => { accumulated.pointCount += props.pointCount; accumulated.totalValue += props.totalValue; } }); ``` ``` -------------------------------- ### Develop Supercluster: Run Tests Source: https://www.npmjs.com/package/supercluster?activeTab=dependents Execute the test suite for Supercluster. ```bash npm test ``` -------------------------------- ### Build Supercluster Source: https://www.npmjs.com/package/supercluster?activeTab=dependencies Build the Supercluster JavaScript files, generating 'dist/supercluster.js' and 'dist/supercluster.min.js'. ```bash npm run build # generate dist/supercluster.js and dist/supercluster.min.js ``` -------------------------------- ### Develop Supercluster: Build Project Source: https://www.npmjs.com/package/supercluster?activeTab=dependents Build the Supercluster project to generate distributable JavaScript files. ```bash npm run build ``` -------------------------------- ### Build Supercluster Source: https://www.npmjs.com/package/supercluster?activeTab=readme Build the Supercluster JavaScript files for distribution. ```bash npm run build # generate dist/supercluster.js and dist/supercluster.min.js ``` -------------------------------- ### Supercluster Options and Property Aggregation Source: https://www.npmjs.com/package/supercluster?activeTab=readme Explains the configuration options for Supercluster, including property map/reduce for custom aggregations. ```APIDOC ## Supercluster Options ### General Options | Option | Default | Description | |----------------|---------|-----------------------------------------------------------------------------| | `minZoom` | 0 | Minimum zoom level at which clusters are generated. | | `maxZoom` | 16 | Maximum zoom level at which clusters are generated. | | `minPoints` | 2 | Minimum number of points to form a cluster. | | `radius` | 40 | Cluster radius, in pixels. | | `extent` | 512 | (Tiles) Tile extent. Radius is calculated relative to this value. | | `nodeSize` | 64 | Size of the KD-tree leaf node. Affects performance. | | `log` | false | Whether timing info should be logged. | | `generateId` | false | Whether to generate ids for input features in vector tiles. | ### Property Map/Reduce Options Supercluster supports property aggregation using `map` and `reduce` functions. - **`map`** (function): A function that returns cluster properties corresponding to a single point. It should return a new object, not mutate the original properties. *Example:* `(props) => ({ sum: props.myValue })` - **`reduce`** (function): A reduce function that merges properties of two clusters into one. It should not mutate the second argument (`props`). *Example:* `(accumulated, props) => { accumulated.sum += props.sum; }` **Conditions for `map`/`reduce`:** - `map` must return a new object. - `reduce` must not mutate the second argument. ### Example of Property Aggregation ```javascript const index = new Supercluster({ map: (props) => ({ sum: props.myValue }), reduce: (accumulated, props) => { accumulated.sum += props.sum; } }); ``` ``` -------------------------------- ### Import Supercluster from CDN Source: https://www.npmjs.com/package/supercluster?activeTab=readme Import the Supercluster library from a CDN for use in browser environments. ```javascript import Supercluster from 'https://esm.run/supercluster'; ``` -------------------------------- ### Supercluster Options and Property Aggregation Source: https://www.npmjs.com/package/supercluster?activeTab=versions Explains the configuration options for Supercluster, including zoom levels, radius, and advanced property map/reduce functions for data aggregation. ```APIDOC ## Supercluster Options and Property Aggregation ### Options | Option | Default | Description | |--------------------|---------|-----------------------------------------------------------------------------| | **minZoom** | 0 | Minimum zoom level at which clusters are generated. | | **maxZoom** | 16 | Maximum zoom level at which clusters are generated. | | **minPoints** | 2 | Minimum number of points required to form a cluster. | | **radius** | 40 | Cluster radius in pixels. | | **extent** | 512 | Tile extent. Radius is calculated relative to this value. | | **nodeSize** | 64 | Size of the KD-tree leaf node. Affects performance. | | **log** | false | If true, timing information will be logged to the console. | | **generateId** | false | If true, generates unique IDs for input features in vector tiles. | ### Property Map/Reduce Options Supercluster supports property aggregation using `map` and `reduce` functions, allowing you to combine properties from individual points into cluster properties. - **`map`**: A function that takes the properties of a single point and returns an object representing the properties to be aggregated for that point within a cluster. - **Important**: This function must return a *new* object; it should not mutate the original properties. - **`reduce`**: A function that takes two arguments: the accumulated properties of a cluster and the aggregated properties of a new point (or another cluster). It should merge these properties and return the updated accumulated properties. - **Important**: This function must not mutate the second argument (`props`). #### Example: Summing a property ```javascript const index = new Supercluster({ // For each point, extract 'myValue' and put it in an object with a 'sum' key map: (props) => ({ sum: props.myValue }), // Merge the 'sum' property from new points into the accumulated sum reduce: (accumulated, props) => { accumulated.sum += props.sum; } }); ``` **Conditions for `map` and `reduce`**: - `map` must return a new object, not the existing `properties` of a point, otherwise it will get overwritten. - `reduce` must not mutate the second argument (`props`). ``` -------------------------------- ### Supercluster Property Aggregation (Map/Reduce) Source: https://www.npmjs.com/package/supercluster?activeTab=dependents Explains how to use custom map and reduce functions to aggregate properties of points into cluster properties. ```APIDOC ## Property Aggregation with Map/Reduce ### Description Supercluster allows for custom aggregation of point properties into cluster properties using `map` and `reduce` functions during initialization. This enables features like summing values, counting occurrences, or calculating averages across clusters. ### Method Constructor Options (`map`, `reduce`) ### Endpoint N/A (Client-side library) ### Parameters #### `map` Function - **Description**: A function that transforms the properties of a single point into the properties of a cluster. - **Signature**: `(props: Object) => Object` - **Requirements**: Must return a new object; do not mutate the original `props`. #### `reduce` Function - **Description**: A function that merges the properties of two clusters (or a point's mapped properties into a cluster). - **Signature**: `(accumulatedProps: Object, props: Object) => Object` - **Requirements**: Must not mutate the second argument (`props`). ### Request Example ```javascript const index = new Supercluster({ // Example: Summing a 'value' property map: (props) => ({ sum: props.value, count: 1 }), reduce: (accumulated, props) => { accumulated.sum += props.sum; accumulated.count += props.count; } }); const points = [ { type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }, properties: { value: 10 } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [1, 1] }, properties: { value: 20 } } ]; index.load(points); const clusters = index.getClusters([-1, -1, 1, 1], 0); console.log(clusters[0].properties); // Expected: { sum: 30, count: 2 } ``` ### Response #### Success Response (200) - **Aggregated Properties**: The `properties` object of the returned cluster features will contain the aggregated values as defined by the `map` and `reduce` functions. #### Response Example ```json { "type": "Feature", "geometry": { "type": "Point", "coordinates": [0.5, 0.5] }, "properties": { "cluster": true, "point_count": 2, "cluster_id": 0, "sum": 30, // Aggregated property "count": 2 // Aggregated property } } ``` ``` -------------------------------- ### Supercluster Tile Generation Source: https://www.npmjs.com/package/supercluster?activeTab=dependents Details on how to generate GeoJSON-compatible tiles for use with libraries like geojson-vt. ```APIDOC ## `getTile(z, x, y)` ### Description Generates a GeoJSON-compatible tile object for a given zoom level and tile coordinates (z, x, y). This is useful for integrating with tile-based map rendering. ### Method `getTile(z, x, y)` ### Endpoint N/A (Client-side library) ### Parameters #### `getTile(z, x, y)` Parameters - **z** (Number) - Required - The zoom level of the tile. - **x** (Number) - Required - The x coordinate of the tile. - **y** (Number) - Required - The y coordinate of the tile. ### Request Example ```javascript // Assuming 'index' is a loaded Supercluster instance const tileData = index.getTile(2, 2, 2); console.log(tileData); ``` ### Response #### Success Response (200) - **tileData** (Object) - A geojson-vt-compatible JSON tile object containing cluster and point features. #### Response Example ```json { "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ ... ] }, "properties": { "cluster": true, "point_count": 10, "cluster_id": 123 } } ], "vtinfo": { ... } // Vector tile information } ``` ``` -------------------------------- ### Supercluster Methods Source: https://www.npmjs.com/package/supercluster?activeTab=versions Details on the core methods available in the Supercluster library for data loading, cluster retrieval, and tile generation. ```APIDOC ## Supercluster Methods ### `load(points)` #### Description Loads an array of GeoJSON Feature objects into the Supercluster index. Each feature's `geometry` must be a GeoJSON Point. Once loaded, the index becomes immutable. #### Parameters - **points** (Array) - Required - An array of GeoJSON Feature objects. ### `getClusters(bbox, zoom)` #### Description Retrieves clusters and points for the given bounding box and zoom level. Returns an array of GeoJSON Feature objects. #### Parameters - **bbox** (Array) - Required - The bounding box array in the format `[westLng, southLat, eastLng, northLat]`. - **zoom** (number) - Required - The integer zoom level. ### `getTile(z, x, y)` #### Description Generates a geojson-vt-compatible JSON tile object for a given zoom level and x/y tile coordinates. Contains cluster and point features. #### Parameters - **z** (number) - Required - The zoom level. - **x** (number) - Required - The x tile coordinate. - **y** (number) - Required - The y tile coordinate. ### `getChildren(clusterId)` #### Description Returns the children of a cluster for the next zoom level, given the cluster's `cluster_id`. #### Parameters - **clusterId** (number | string) - Required - The `cluster_id` of the cluster. ### `getLeaves(clusterId, limit = 10, offset = 0)` #### Description Retrieves all the individual points contained within a cluster, with support for pagination. Useful for displaying points when a cluster is clicked. #### Parameters - **clusterId** (number | string) - Required - The `cluster_id` of the cluster. - **limit** (number) - Optional - The maximum number of points to return. Set to `Infinity` to retrieve all points. Default: 10. - **offset** (number) - Optional - The number of points to skip for pagination. Default: 0. ### `getClusterExpansionZoom(clusterId)` #### Description Calculates and returns the zoom level at which a given cluster expands into its children. This is useful for implementing "click-to-zoom" functionality. #### Parameters - **clusterId** (number | string) - Required - The `cluster_id` of the cluster. ``` -------------------------------- ### Include Supercluster via Script Tag Source: https://www.npmjs.com/package/supercluster?activeTab=readme Include the Supercluster library in a browser environment using a standard script tag. ```html ``` -------------------------------- ### Supercluster Methods Source: https://www.npmjs.com/package/supercluster Details on the core methods available in the Supercluster library for managing and querying clustered data. ```APIDOC ## Supercluster Methods ### Description This section details the primary methods provided by the Supercluster library for loading data and retrieving clustered information. ### `load(points)` #### Description Loads an array of GeoJSON Feature objects into the Supercluster index. Each feature's `geometry` must be a GeoJSON Point. Once loaded, the index becomes immutable. #### Parameters - **points** (Array) - Required - An array of GeoJSON Feature objects. ### `getClusters(bbox, zoom)` #### Description Retrieves an array of clusters and points as GeoJSON Feature objects for the given bounding box and zoom level. #### Parameters - **bbox** (Array) - Required - The bounding box array in the format `[westLng, southLat, eastLng, northLat]`. - **zoom** (Number) - Required - The integer zoom level. #### Response - **Array** - An array of GeoJSON Feature objects, where each feature is either a point or a cluster. Clusters have `properties.cluster === true` and a `properties.cluster_id`. ### `getTile(z, x, y)` #### Description Returns a geojson-vt-compatible JSON tile object containing cluster/point features for a given zoom level and x/y tile coordinates. #### Parameters - **z** (Number) - Required - The zoom level. - **x** (Number) - Required - The x coordinate of the tile. - **y** (Number) - Required - The y coordinate of the tile. #### Response - **Object** - A JSON tile object compatible with geojson-vt. ### `getChildren(clusterId)` #### Description Returns the children of a cluster (at the next zoom level) given its `cluster_id`. #### Parameters - **clusterId** (Number | String) - Required - The `cluster_id` of the cluster whose children are to be retrieved. #### Response - **Array** - An array of GeoJSON Feature objects representing the children of the cluster. ### `getLeaves(clusterId, limit = 10, offset = 0)` #### Description Returns all the points belonging to a cluster, with support for pagination. Useful for displaying individual points within a cluster when it's expanded. #### Parameters - **clusterId** (Number | String) - Required - The `cluster_id` of the cluster. - **limit** (Number) - Optional - The maximum number of points to return. Defaults to 10. Use `Infinity` to retrieve all points. - **offset** (Number) - Optional - The number of points to skip for pagination. Defaults to 0. #### Response - **Array** - An array of GeoJSON Feature objects representing the points within the cluster. ### `getClusterExpansionZoom(clusterId)` #### Description Returns the zoom level at which a given cluster expands into its children. This is useful for implementing 'click-to-zoom' functionality. #### Parameters - **clusterId** (Number | String) - Required - The `cluster_id` of the cluster. #### Response - **Number** - The zoom level at which the cluster expands. ``` -------------------------------- ### Supercluster Methods Source: https://www.npmjs.com/package/supercluster?activeTab=readme Details on the core methods available in the Supercluster library for data manipulation and retrieval. ```APIDOC ## Supercluster Methods ### `load(points)` #### Description Loads an array of GeoJSON Feature objects into the Supercluster index. Once loaded, the index becomes immutable. #### Parameters - **points** (Array) - Required - An array of GeoJSON Feature objects. Each feature's `geometry` must be a GeoJSON Point. ### `getClusters(bbox, zoom)` #### Description Retrieves clustered points for a given bounding box and zoom level. #### Parameters - **bbox** (Array) - Required - The bounding box in the format `[westLng, southLat, eastLng, northLat]`. - **zoom** (number) - Required - The integer zoom level. #### Returns An array of GeoJSON Feature objects, representing points and clusters. ### `getTile(z, x, y)` #### Description Generates a geojson-vt-compatible JSON tile object for a given zoom and tile coordinates. #### Parameters - **z** (number) - Required - The zoom level. - **x** (number) - Required - The tile's x coordinate. - **y** (number) - Required - The tile's y coordinate. #### Returns A JSON tile object compatible with `geojson-vt`. ### `getChildren(clusterId)` #### Description Retrieves the children of a cluster at the next zoom level. #### Parameters - **clusterId** (number | string) - Required - The `cluster_id` of the cluster whose children are to be retrieved. #### Returns An array of GeoJSON Feature objects representing the children of the cluster. ### `getLeaves(clusterId, limit = 10, offset = 0)` #### Description Retrieves all points belonging to a cluster, with support for pagination. #### Parameters - **clusterId** (number | string) - Required - The `cluster_id` of the cluster. - **limit** (number) - Optional - The maximum number of points to return. Set to `Infinity` to retrieve all points. Default: 10. - **offset** (number) - Optional - The number of points to skip for pagination. Default: 0. #### Returns An array of GeoJSON Feature objects representing the points within the cluster. ### `getClusterExpansionZoom(clusterId)` #### Description Determines the zoom level at which a given cluster expands into multiple children. #### Parameters - **clusterId** (number | string) - Required - The `cluster_id` of the cluster. #### Returns The zoom level at which the cluster expands. ``` -------------------------------- ### Import Supercluster as ES Module Source: https://www.npmjs.com/package/supercluster?activeTab=readme Import the Supercluster library as an ES module for use in Node.js environments. ```javascript import Supercluster from 'supercluster'; ``` -------------------------------- ### Supercluster Cluster Navigation Source: https://www.npmjs.com/package/supercluster?activeTab=dependents Methods for exploring cluster hierarchies and retrieving individual points within clusters. ```APIDOC ## Cluster Navigation Methods ### Description These methods allow you to inspect the structure of clusters, retrieve their children, and paginate through the individual points contained within a cluster. ### Methods #### `getChildren(clusterId)` Retrieves the immediate children of a cluster. These children represent the points or sub-clusters that form the parent cluster at the next zoom level. #### `getLeaves(clusterId, limit, offset)` Retrieves all individual points contained within a specified cluster, with support for pagination. #### `getClusterExpansionZoom(clusterId)` Determines the zoom level at which a given cluster will expand into its constituent children. This is useful for implementing 'click-to-zoom' functionality. ### Parameters #### `getChildren(clusterId)` Parameters - **clusterId** (Number) - Required - The `cluster_id` of the cluster whose children are to be retrieved. #### `getLeaves(clusterId, limit, offset)` Parameters - **clusterId** (Number) - Required - The `cluster_id` of the cluster whose points are to be retrieved. - **limit** (Number) - Optional - The maximum number of points to return. Defaults to 10. Use `Infinity` to retrieve all points. - **offset** (Number) - Optional - The number of points to skip for pagination. Defaults to 0. #### `getClusterExpansionZoom(clusterId)` Parameters - **clusterId** (Number) - Required - The `cluster_id` of the cluster for which to find the expansion zoom level. ### Request Example ```javascript // Assuming 'index' is a loaded Supercluster instance and 'clusterId' is known // Get children of a cluster const children = index.getChildren(clusterId); // Get the first 5 points of a cluster const leaves = index.getLeaves(clusterId, 5); // Get the zoom level at which a cluster expands const expansionZoom = index.getClusterExpansionZoom(clusterId); ``` ### Response #### Success Response (200) - **`getChildren` Response**: Array of GeoJSON Features (points or sub-clusters). - **`getLeaves` Response**: Array of GeoJSON Features (individual points). - **`getClusterExpansionZoom` Response**: Number representing the zoom level. #### Response Example ```json // Example for getChildren: [ { "type": "Feature", "geometry": { ... }, "properties": { ... } }, { "type": "Feature", "geometry": { ... }, "properties": { "cluster": true, "point_count": 3, "cluster_id": 124 } } ] // Example for getLeaves: [ { "type": "Feature", "geometry": { ... }, "properties": { "name": "Point A" } }, { "type": "Feature", "geometry": { ... }, "properties": { "name": "Point B" } } ] // Example for getClusterExpansionZoom: 10 ``` ``` -------------------------------- ### Supercluster Tile API Source: https://www.npmjs.com/package/supercluster?activeTab=dependencies Provides methods for generating GeoJSON-compatible tiles and retrieving cluster information. ```APIDOC ## Supercluster Tile API ### Description Methods for retrieving tile data and information about specific clusters. ### Method - `getTile(z, x, y)` - `getChildren(clusterId)` - `getLeaves(clusterId, limit, offset)` - `getClusterExpansionZoom(clusterId)` ### Endpoint N/A (Client-side library) ### Parameters #### `getTile(z, x, y)` Parameters - **z** (number) - Required - Zoom level. - **x** (number) - Required - Tile x coordinate. - **y** (number) - Required - Tile y coordinate. #### `getChildren(clusterId)` Parameters - **clusterId** (number) - Required - The `cluster_id` of the cluster. #### `getLeaves(clusterId, limit, offset)` Parameters - **clusterId** (number) - Required - The `cluster_id` of the cluster. - **limit** (number) - Optional - Maximum number of points to return. Default: 10. - **offset** (number) - Optional - Number of points to skip. Default: 0. #### `getClusterExpansionZoom(clusterId)` Parameters - **clusterId** (number) - Required - The `cluster_id` of the cluster. ### Request Example ```javascript // Assuming 'index' is an initialized Supercluster instance with loaded points const tile = index.getTile(10, 512, 256); const children = index.getChildren(0); const leaves = index.getLeaves(0, 5, 10); const expansionZoom = index.getClusterExpansionZoom(0); ``` ### Response #### Success Response (200) - **`getTile`**: Returns a geojson-vt-compatible JSON tile object. - **`getChildren`**: Returns an array of child cluster/point features. - **`getLeaves`**: Returns paginated array of points within a cluster. - **`getClusterExpansionZoom`**: Returns the zoom level at which the cluster expands. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.