diff options
author | Justin R. Miller <incanus@users.noreply.github.com> | 2016-10-04 18:42:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-04 18:42:12 -0700 |
commit | 105673efc1c59e19f5352fb770405aa591cdebeb (patch) | |
tree | 7b57c89ad346a4e62c60c404338d0b34853ad02b /platform/darwin/src/MGLMultiPoint.h | |
parent | 07315711d6b191a5812065bb76ab5beb33d995d9 (diff) | |
download | qtlocation-mapboxgl-105673efc1c59e19f5352fb770405aa591cdebeb.tar.gz |
[ios, macos] fixes #6160: allow updating multipoint coordinates (#6565)
Diffstat (limited to 'platform/darwin/src/MGLMultiPoint.h')
-rw-r--r-- | platform/darwin/src/MGLMultiPoint.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLMultiPoint.h b/platform/darwin/src/MGLMultiPoint.h index 59d9cd9429..69c7295842 100644 --- a/platform/darwin/src/MGLMultiPoint.h +++ b/platform/darwin/src/MGLMultiPoint.h @@ -15,7 +15,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface MGLMultiPoint : MGLShape -/** The array of coordinates associated with the shape. */ +/** + 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) */ @@ -35,6 +43,22 @@ NS_ASSUME_NONNULL_BEGIN */ - (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 |