GLMapPointArray

Objective-C


@interface GLMapPointArray : NSObject

Swift

class GLMapPointArray : NSObject

Array of GLMapPoint. Useful for loading lines and polygons into GLMapVectorObject. Based on C++ vector and works faster with GLMapPoints without ObjC overhead.

  • Initializes GLMapPointArray.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Initializes GLMapPointArray with an initial capacity hint.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCapacity:(NSUInteger)initialCapacity;

    Swift

    init(capacity initialCapacity: UInt)
  • Initializes GLMapPointArray with an array of points.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPoints:(nonnull GLMapPoint *)points
                                     count:(NSUInteger)count;

    Swift

    init(points: UnsafeMutablePointer<GLMapPoint>, count: UInt)
  • Initializes GLMapPointArray with a callback. Useful in case of generated geometry or converting data without creating an additional array.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCount:(NSUInteger)count
                                 callback:(nonnull GetPointBlock)callback;

    Swift

    init(count: UInt, callback: @escaping GetPointBlock)
  • Adds points to the array.

    Declaration

    Objective-C

    - (BOOL)addPoints:(const GLMapPoint *_Nonnull)points count:(NSUInteger)count;

    Swift

    func addPoints(_ points: UnsafePointer<GLMapPoint>, count: UInt) -> Bool
  • Adds a single point to the array.

    Declaration

    Objective-C

    - (BOOL)addPoint:(GLMapPoint)pt;

    Swift

    func add(_ pt: GLMapPoint) -> Bool
  • The number of points in the array.

    Declaration

    Objective-C

    @property (readonly) NSUInteger count;

    Swift

    var count: UInt { get }
  • Returns point at the index.

    Declaration

    Objective-C

    - (GLMapPoint)pointAtIndex:(NSUInteger)index;

    Swift

    func point(at index: UInt) -> GLMapPoint

    Parameters

    index

    Point index.

    Return Value

    Point value.

  • Enumerates points with a block.

    Declaration

    Objective-C

    - (void)enumeratePointsWithBlock:(nonnull EnumeratePointBlock)block;

    Swift

    func enumeratePoints() async -> (UInt, GLMapPoint)

    Parameters

    block

    Enumerator block.