MSFClusteredVectorLayer
Objective-C
@interface MSFClusteredVectorLayer : MSFVectorLayer
Swift
class MSFClusteredVectorLayer : MSFVectorLayer
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:(MSFLocalVectorDataSource *)dataSource clusterElementBuilder:(MSFClusterElementBuilder *)clusterElementBuilder;Swift
init!(dataSource: MSFLocalVectorDataSource!, clusterElementBuilder: MSFClusterElementBuilder!)Parameters
dataSourceThe local data source that contains the elements for clustering.
clusterElementBuilderThe callback for creating and customizing cluster elements.
-
Returns the current callback used for creating cluster elements.
Declaration
Objective-C
- (MSFClusterElementBuilder *)getClusterElementBuilder;Swift
func getClusterElementBuilder() -> MSFClusterElementBuilder!Return Value
The associated callback.
-
Returns the current minimum distance between clusters (in device-independent pixels).
Declaration
Objective-C
- (float)getMinimumClusterDistance;Swift
func getMinimumClusterDistance() -> FloatReturn Value
The current minimum clustering distance.
-
Sets the minimum distance between clusters (in device-independent pixels).
Declaration
Objective-C
- (void)setMinimumClusterDistance:(float)px;Swift
func setMinimumClusterDistance(_ px: Float)Parameters
pxThe 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;Swift
func getMaximumClusterZoom() -> FloatReturn 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;Swift
func setMaximumClusterZoom(_ maxZoom: Float)Parameters
maxZoomThe new maximum clustering zoom level.
-
Returns the cluster animation flag value.
Declaration
Objective-C
- (BOOL)isAnimatedClusters;Swift
func isAnimatedClusters() -> BoolReturn 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;Swift
func setAnimatedClusters(_ animated: Bool)Parameters
animatedThe 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:(MSFVectorElement *)clusterElement px:(float)px;Swift
func expandCluster(_ clusterElement: MSFVectorElement!, px: Float) -> BoolParameters
clusterElementThe cluster element to expand or shrink.
pxThe 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;Swift
func refresh() -
Undocumented
Declaration
Objective-C
-(void)dealloc;Swift
func dealloc()