MaplyBasicClusterGenerator

Objective-C

@interface MaplyBasicClusterGenerator : NSObject <MaplyClusterGenerator>

Swift

class MaplyBasicClusterGenerator : NSObject, MaplyClusterGenerator

The basic cluster generator installed by default.

This cluster generator will make images for grouped clusters of markers/labels.

  • Initialize with a list of colors.

    Initialize with a list of colors. Each order of magnitude will use another color. Must provide at least 1.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithColors:(NSArray *_Nonnull)colors
         clusterNumber:(int)clusterNumber
                  size:(CGSize)markerSize
                 viewC:(NSObject<MaplyRenderControllerProtocol> *_Nonnull)viewC;
  • The ID number corresponding to the cluster. Every marker/label with this cluster ID will be grouped together.

    Declaration

    Objective-C

    @property (nonatomic) int clusterNumber;

    Swift

    var clusterNumber: Int32 { get set }
  • 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

    @property (nonatomic) CGSize clusterLayoutSize;

    Swift

    var clusterLayoutSize: CGSize { get set }
  • Set to use appearance and coordinate of cluster group marker with highest importance. Off by default.

    Declaration

    Objective-C

    @property (nonatomic) _Bool showMarkerWithHighestImportance;

    Swift

    var showMarkerWithHighestImportance: Bool { get set }
  • Set this if you want cluster to be user selectable. On by default.

    Declaration

    Objective-C

    @property (nonatomic) _Bool selectable;

    Swift

    var selectable: Bool { get set }
  • How long to animate markers the join and leave a cluster

    Declaration

    Objective-C

    @property (nonatomic) double markerAnimationTime;

    Swift

    var markerAnimationTime: Double { get set }
  • The shader to use when moving objects around When warping objects to their new locations we use a motion shader. Set this if you want to override the default.

    Declaration

    Objective-C

    @property (nonatomic, strong) MaplyShader *_Nullable motionShader;

    Swift

    var motionShader: MaplyShader? { get set }