GLMapMarkerStyleCollection

Objective-C


@interface GLMapMarkerStyleCollection : NSObject

Swift

class GLMapMarkerStyleCollection : NSObject

GLMapMarkerStyleCollection class holds a collection of styles used to draw a marker layer.

  • Declaration

    Objective-C

    - (instancetype _Nonnull)init;

    Swift

    init()

    Return Value

    Returns a new instance of GLMapMarkerStyleCollection.

  • Adds a block used to fill data for markers. GLMapMarkerDataFillBlock is called for each marker, it should set marker information into GLMapMarkerData variable using GLMapMarkerSetStyle, GLMapMarkerSetText functions.

    Declaration

    Objective-C

    - (void)setMarkerDataFillBlock:(GLMapMarkerDataFillBlock _Nullable)block;

    Swift

    func setMarkerDataFill(_ block: GLMapMarkerDataFillBlock?)

    Parameters

    block

    A marker data fill block.

  • Sets a block used to get the location for markers.

    Declaration

    Objective-C

    - (void)setMarkerLocationBlock:(GLMapMarkerLocationBlock _Nullable)block;

    Swift

    func setMarkerLocationBlock(_ block: GLMapMarkerLocationBlock?)

    Parameters

    block

    A marker location block.

  • GLMapMarkerUnionBlock is called when the marker layer needs a style for a union of count markers. It should return a number.

    Declaration

    Objective-C

    - (void)setMarkerUnionFillBlock:(GLMapMarkerUnionFillBlock _Nullable)block;

    Swift

    func setMarkerUnionFill(_ block: GLMapMarkerUnionFillBlock?)

    Parameters

    block

    A cluster data fill block.

  • Adds a new style to the collection that has only one image.

    Declaration

    Objective-C

    - (uint32_t)addStyleWithImage:(PlatformImage *_Nonnull)image;

    Swift

    func addStyle(with image: NSImage) -> UInt32

    Parameters

    image

    The image that will have the default offset (center of the image).

    Return Value

    The index in the collection for this style.

  • Adds a new style to the collection that has several images.

    Declaration

    Objective-C

    - (uint32_t)addStyleWithImages:(NSArray<PlatformImage *> *_Nonnull)images;

    Swift

    func addStyle(with images: [NSImage]) -> UInt32

    Parameters

    images

    An array of images that will have the default offset (center of the image).

    Return Value

    The index in the collection for this style.

  • Adds a new style to the collection that has images with offsets.

    Declaration

    Objective-C

    - (uint32_t)addStyleWithImages:(NSArray<PlatformImage *> *_Nonnull)images
                        andOffsets:(NSArray<NSValue *> *_Nullable)offsets;

    Swift

    func addStyle(with images: [NSImage], andOffsets offsets: [NSValue]?) -> UInt32

    Parameters

    images

    An array of images.

    offsets

    Offsets of the images.

    Return Value

    The index in the collection for this style.

  • Sets a name for the style that can be used from mapcss.

    Declaration

    Objective-C

    - (void)setStyleName:(NSString *_Nonnull)name
           forStyleIndex:(uint32_t)styleIndex;

    Swift

    func setStyleName(_ name: String, forStyleIndex styleIndex: UInt32)

    Parameters

    styleIndex

    The index of the style.

    name

    The name to set.