summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLMultiPoint.h
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-11-14 09:34:22 -0800
committerGitHub <noreply@github.com>2016-11-14 09:34:22 -0800
commit44e398865e7fa2b0186b9b93c9efcfa53e985566 (patch)
treef10f1d39854eda6834e421ba76d3ab536e880615 /platform/darwin/src/MGLMultiPoint.h
parent96a7a4402ef5eac2fa17ec7b52ef24e3b10bbf29 (diff)
downloadqtlocation-mapboxgl-44e398865e7fa2b0186b9b93c9efcfa53e985566.tar.gz
[ios, macos] Use std::vector for MGLMultiPoint coordinate storage (#6890)
Refactor the previous C array based implementation to use C++ std::vector. This is done to avoid potential safety and security issues with the previous approach.
Diffstat (limited to 'platform/darwin/src/MGLMultiPoint.h')
-rw-r--r--platform/darwin/src/MGLMultiPoint.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLMultiPoint.h b/platform/darwin/src/MGLMultiPoint.h
index 69c7295842..5a37e25cc3 100644
--- a/platform/darwin/src/MGLMultiPoint.h
+++ b/platform/darwin/src/MGLMultiPoint.h
@@ -48,17 +48,26 @@ NS_ASSUME_NONNULL_BEGIN
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.
+ 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. The array in _`coords`_ must be equal in number to the
+ length of the range. If you want to append to the existing coordinates
+ array use `-[MGLMultiPoint appendCoordinates:count:]`.
@param coords The array of coordinates defining the shape. The data in this
- array is copied to the object.
+ array is copied to the object.
*/
- (void)replaceCoordinatesInRange:(NSRange)range withCoordinates:(CLLocationCoordinate2D *)coords;
+/**
+ Appends 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 coords The array of coordinates to add to the shape. The data in this
+ array is copied to the new object.
+ @param count The number of items in the `coords` array.
+ */
+- (void)appendCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
+
@end
NS_ASSUME_NONNULL_END