1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "MGLShape.h"
NS_ASSUME_NONNULL_BEGIN
/**
The `MGLMultiPoint` class is used to define shapes composed of multiple points.
This class is also the superclass of `MGLPolyline` and `MGLPolygon`. The
methods and properties of this class can be used to access information about
the specific points associated with a line or polygon.
*/
@interface MGLMultiPoint : MGLShape
/**
Creates and returns an `MGLMultiPoint` object from the specified set of
coordinates.
@param coords The array of coordinates defining the shape. The data in this
array is copied to the new object.
@param count The number of items in the `coords` array.
@return A new multipoint object.
*/
+ (instancetype)multiPointWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count NS_SWIFT_NAME(multiPoint(coordinates:count:));
/**
The array of coordinates associated with the shape.
This C array is a pointer to a structure inside the multipoint object,
which may have a lifetime shorter than the multipoint object and will
certainly not have a longer lifetime. Therefore, you should copy the C
array if it needs to be stored outside of the memory context in which you
use this property.
*/
@property (nonatomic, readonly) CLLocationCoordinate2D *coordinates NS_RETURNS_INNER_POINTER;
/** The number of coordinates associated with the shape. (read-only) */
@property (nonatomic, readonly) NSUInteger pointCount;
/**
Retrieves one or more coordinates associated with the shape.
@param coords On input, you must provide a C array of structures large enough
to hold the desired number of coordinates. On output, this structure
contains the requested coordinate data.
@param range The range of points you want. The `location` field indicates the
first point you are requesting, with `0` being the first point, `1` being
the second point, and so on. The `length` field indicates the number of
points you want. The array in _`coords`_ must be large enough to accommodate
the number of requested coordinates.
*/
- (void)getCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range;
/**
Updates one or more coordinates for the shape, which will instantaneously
cause the shape to be redrawn if it is currently visible on the map.
@param range The range of points to update. The `location` field indicates the
first point you are replacing, with `0` being the first point, `1` being
the second point, and so on. The `length` field indicates the number of
points to update. You can append to an existing array of coordinates
by specifying a range with a `location` at the end of the existing array
and/or a `length` which extends past the end of the existing array. The array
in _`coords`_ must be equal in number to the length of the range.
@param coords The array of coordinates defining the shape. The data in this
array is copied to the object.
*/
- (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(CLLocationCoordinate2D *)coords;
@end
NS_ASSUME_NONNULL_END
|