MaplyClusterGenerator

Objective-C

@protocol MaplyClusterGenerator <NSObject>

Swift

protocol MaplyClusterGenerator : NSObjectProtocol

Fill in this protocol to provide images when individual markers/labels are clustered.

This is the protocol for marker/label clustering. You must fill this in and register the cluster

  • Called at the start of clustering.

    Called right before we start generating clusters. Do you setup here if need be.

    Declaration

    Objective-C

    - (void)startClusterGroup;

    Swift

    func startClusterGroup()
  • Generate a cluster group for a given collection of markers.

    Generate an image and size to represent the number of marker/labels we’re consolidating.

    Note

    Will not be called if -showMarkerWithHighestImportance returns true.

    Declaration

    Objective-C

    - (MaplyClusterGroup *_Nonnull)makeClusterGroup:
        (MaplyClusterInfo *_Nonnull)clusterInfo;

    Swift

    func makeClusterGroup(_ clusterInfo: MaplyClusterInfo) -> MaplyClusterGroup
  • Called at the end of clustering.

    If you were doing optimization (for image reuse, say) clean it up here.

    Declaration

    Objective-C

    - (void)endClusterGroup;

    Swift

    func endClusterGroup()
  • Return the cluster number we’re covering

    Declaration

    Objective-C

    - (int)clusterNumber;

    Swift

    func clusterNumber() -> Int32
  • The size of the cluster that will be created. This is the biggest cluster you’re likely to create. We use it to figure overlaps between clusters.

    Declaration

    Objective-C

    - (CGSize)clusterLayoutSize;

    Swift

    func clusterLayoutSize() -> CGSize
  • Use appearance and coordinate of cluster group marker with highest importance. If not set then an average of coordinates will be used

    Declaration

    Objective-C

    - (_Bool)showMarkerWithHighestImportance;

    Swift

    func showMarkerWithHighestImportance() -> Bool
  • Set this if you want cluster to be user selectable. On by default.

    Declaration

    Objective-C

    - (_Bool)selectable;

    Swift

    func selectable() -> Bool
  • How long to animate markers the join and leave a cluster

    Declaration

    Objective-C

    - (double)markerAnimationTime;

    Swift

    func markerAnimationTime() -> Double
  • The shader to use for moving objects around If you’re doing animation from point to cluster you need to provide a suitable shader.

    Declaration

    Objective-C

    - (MaplyShader *_Nullable)motionShader;

    Swift

    func motionShader() -> MaplyShader?