NTClusteredVectorLayer


@interface NTClusteredVectorLayer : NTVectorLayer

A vector layer that supports clustering point-type features. A Pairwise centroid hierarchical clustering algorithm is used internally.

  • Constructs a new ClusteredVectorLayer instance from data source and a special callback.

    Declaration

    Objective-C

    - (id)initWithDataSource:(NTLocalVectorDataSource *)dataSource
        clusterElementBuilder:(NTClusterElementBuilder *)clusterElementBuilder;

    Parameters

    dataSource

    The local data source that contains the elements for clustering.

    clusterElementBuilder

    The callback for creating and customizing cluster elements.

  • Returns the current callback used for creating cluster elements.

    Declaration

    Objective-C

    - (NTClusterElementBuilder *)getClusterElementBuilder;

    Return Value

    The associated callback.

  • Returns the current minimum distance between clusters (in device-independent pixels).

    Declaration

    Objective-C

    - (float)getMinimumClusterDistance;

    Return Value

    The current minimum clustering distance.

  • Sets the minimum distance between clusters (in device-independent pixels).

    Declaration

    Objective-C

    - (void)setMinimumClusterDistance:(float)px;

    Parameters

    px

    The new value in device-independent pixels. The default is 100.

  • Returns the maximum zoom level when clusters are shown. If zoom level is greater, then clusters are replaced with individual elements. Default is 24.

    Declaration

    Objective-C

    - (float)getMaximumClusterZoom;

    Return Value

    The maximum clustering zoom level.

  • Sets the maximum zoom level when clusters are shown. If zoom level is greater, then clusters are replaced with individual elements.

    Declaration

    Objective-C

    - (void)setMaximumClusterZoom:(float)maxZoom;

    Parameters

    maxZoom

    The new maximum clustering zoom level.

  • Returns the cluster animation flag value.

    Declaration

    Objective-C

    - (BOOL)isAnimatedClusters;

    Return Value

    True if animation is enabled, false otherwise.

  • Enables or disables the animation of clusters. By default animations are enabled.

    Declaration

    Objective-C

    - (void)setAnimatedClusters:(BOOL)animated;

    Parameters

    animated

    The animated flag.

  • Expands or shrinks the given cluster element. In expanded state, all elements of the cluster are placed at specified distance from the cluster center.

    Declaration

    Objective-C

    - (BOOL)expandCluster:(NTVectorElement *)clusterElement px:(float)px;

    Parameters

    clusterElement

    The cluster element to expand or shrink.

    px

    The distance (in device-independent pixels) between cluster center and expanded elements. Use 0 to shrink already expanded cluster.

    Return Value

    True if the element was found and expanded/shrunk. False otherwise.

  • Undocumented

    Declaration

    Objective-C

    - (void)refresh;
  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;