pub struct Supercluster { /* private fields */ }
Expand description
Create this via a SuperclusterBuilder.
Implementations§
Source§impl Supercluster
impl Supercluster
Sourcepub fn get_clusters(
&self,
min_lng: f64,
min_lat: f64,
max_lng: f64,
max_lat: f64,
zoom: usize,
) -> Vec<ClusterInfo>
pub fn get_clusters( &self, min_lng: f64, min_lat: f64, max_lng: f64, max_lat: f64, zoom: usize, ) -> Vec<ClusterInfo>
Get clusters within a given bounding box and zoom.
Returns a vec of ClusterInfo objects which point into indices of the original input data.
Sourcepub fn get_children(
&self,
cluster_id: ClusterId,
) -> Result<Vec<ClusterInfo>, SuperclusterError>
pub fn get_children( &self, cluster_id: ClusterId, ) -> Result<Vec<ClusterInfo>, SuperclusterError>
Returns the children of a cluster (on the next zoom level) given its id.
You can access a cluster’s id via the ClusterInfo::id
method.
Sourcepub fn get_leaves(
&self,
cluster_id: ClusterId,
limit: Option<usize>,
offset: Option<usize>,
) -> Result<Vec<ClusterInfo>, SuperclusterError>
pub fn get_leaves( &self, cluster_id: ClusterId, limit: Option<usize>, offset: Option<usize>, ) -> Result<Vec<ClusterInfo>, SuperclusterError>
Returns all the points of a cluster (given its cluster_id), with pagination support: limit is the number of points to return (set to Infinity for all points), and offset is the amount of points to skip (for pagination).
You can access a cluster’s id via the ClusterInfo::id
method.
If not provided, limit
defaults to 10
and offset
defaults to 0
.
Sourcepub fn get_cluster_expansion_zoom(
&self,
cluster_id: ClusterId,
) -> Result<usize, SuperclusterError>
pub fn get_cluster_expansion_zoom( &self, cluster_id: ClusterId, ) -> Result<usize, SuperclusterError>
Returns the zoom on which the cluster expands into several children (useful for “click to zoom” feature) given the cluster’s id.
You can access a cluster’s id via the ClusterInfo::id
method.
Trait Implementations§
Source§impl Clone for Supercluster
impl Clone for Supercluster
Source§fn clone(&self) -> Supercluster
fn clone(&self) -> Supercluster
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more