diff options
author | Jesse Bounds <jesse@rebounds.net> | 2016-10-07 15:58:51 -0700 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2016-10-14 14:59:28 -0700 |
commit | 0a8858f2da4f637fbf8ae7d3f5ffe4640d3e0c80 (patch) | |
tree | 07afe5efdc678ad58e405d728b65710d50928dff /platform/darwin/src/MGLMultiPoint.h | |
parent | f558f6bc4a12fc621589c0b0f50d42c18e00453c (diff) | |
download | qtlocation-mapboxgl-0a8858f2da4f637fbf8ae7d3f5ffe4640d3e0c80.tar.gz |
[ios, macos] Teach features and shapes about GeoJSON and mbgl types
MGLShape subclasses can now return NSDictionaries that represent the shapes' GeoJSON geometries. MGLFeature classes can now return NSDictionaries that represent the features as GeoJSON features. This makes it trivial to serialize iOS and macOS shapes and features into GeoJSON.
MGLFeature instances can also return a representation of themselves as an mbgl::Feature. This capability is used in a refactoring of the implementations of MGLGeoJSONSource to more efficiently transform MGLFeatures into mbgl::Features so they can be fed directly into mbgl::GeoJSONSource without having to round trip through NSJSONSerialization. The MGLFeature identifier is converted into the mbgl::identifier type based on the type of the identifier. The MGLFeature attributes are recursively converted into an mbgl::PropertyMap and each value is converted into one of the types that the PropertyMap's Value variant supports.
Diffstat (limited to 'platform/darwin/src/MGLMultiPoint.h')
-rw-r--r-- | platform/darwin/src/MGLMultiPoint.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/platform/darwin/src/MGLMultiPoint.h b/platform/darwin/src/MGLMultiPoint.h index 69c7295842..b33d68f867 100644 --- a/platform/darwin/src/MGLMultiPoint.h +++ b/platform/darwin/src/MGLMultiPoint.h @@ -6,16 +6,25 @@ NS_ASSUME_NONNULL_BEGIN /** - The `MGLMultiPoint` class is an abstract superclass used to define shapes - composed of multiple points. You should not create instances of this class - directly. Instead, you should create instances of the `MGLPolyline` or - `MGLPolygon` classes. However, you can use the method and properties of this - class to access information about the specific points associated with the line - or polygon. + 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; + +/** The array of coordinates associated with the shape. This C array is a pointer to a structure inside the multipoint object, |