@interface MGLShapeCollection : MGLShape
MGLShapeCollection object represents a shape consisting of zero or more
distinct but related shapes that are instances of
MGLShape. The constituent
shapes can be a mixture of different kinds of shapes.
MGLShapeCollection is most commonly used to add multiple shapes to a single
MGLShapeSource. Configure the appearance of an
MGLVectorTileSource’s shape collection collectively using an
MGLSymbolStyleLayer object, or use multiple instances of
configure the appearance of each kind of shape inside the collection.
You cannot add an
MGLShapeCollection object directly to a map view as an
annotation. However, you can create individual
MGLPolygon objects from the
shapes array and add those
annotation objects to the map view using the
To represent a collection of point, polyline, or polygon shapes, it may be more
convenient to use an
MGLMultiPolygon object, respectively. To access a shape collection’s
attributes, use the corresponding
A shape collection is known as a GeometryCollection geometry in GeoJSON.
Creates and returns a shape collection consisting of the given shapes.
+ (nonnull instancetype)shapeCollectionWithShapes: (nonnull NSArray<MGLShape *> *)shapes;
convenience init(shapes: [MGLShape])
The array of shapes defining the shape collection. The data in this array is copied to the new object.
A new shape collection object.