GLMapLabel

Objective-C


@interface GLMapLabel : GLMapDrawable

Swift

class GLMapLabel : GLMapDrawable

GLMapLabel draws a label on the map.

  • Initializes an empty label that will be displayed with the given drawOrder.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDrawOrder:(int32_t)drawOrder;

    Swift

    init(drawOrder: Int32)

    Parameters

    drawOrder

    The drawOrder of the object.

  • Initializes a label that will be injected into the map tile data (for example, you can set a vector object that can be displayed under map elements).

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Sets the text to draw.

    Declaration

    Objective-C

    - (void)setText:(nonnull NSString *)text
          withStyle:(nonnull GLMapVectorStyle *)style
         completion:(dispatch_block_t _Nullable)completion;

    Swift

    func setText(_ text: String, with style: GLMapVectorStyle) async

    Parameters

    text

    The new text.

    style

    The style object used for the text.

    completion

    A block called when the text is replaced.

  • Creates a new string with a line break near the position.

    Declaration

    Objective-C

    + (nonnull NSString *)breakLine:(nonnull NSString *)text
                           position:(NSInteger)position;

    Swift

    class func breakLine(_ text: String, position: Int) -> String

    Parameters

    text

    The text to break.

    position

    The position where the line break will be placed.

    Return Value

    A new string with a break.

  • Creates a new string with a line break near the default position.

    Declaration

    Objective-C

    + (nonnull NSString *)breakLine:(nonnull NSString *)text;

    Swift

    class func breakLine(_ text: String) -> String

    Parameters

    text

    The text to break.

    Return Value

    A new string with a break.