MGLMultiPolygon

@interface MGLMultiPolygon : MGLShape <MGLOverlay>

The MGLMultiPolygon class represents a shape consisting of one or more polygons that do not overlap. For example, you would use an MGLMultiPolygon object to represent an atoll together with an island in the atoll’s lagoon: the atoll itself would be one MGLPolygon object, while the inner island would be another.

Note

MGLMultiPolygon objects cannot be added to a map view using -[MGLMapView addAnnotations:] and related methods.
  • An array of polygons forming the multipolygon.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSArray<MGLPolygon *> *_Nonnull polygons;

    Swift

    var polygons: [MGLPolygon] { get }
  • Creates and returns a multipolygon object consisting of the given polygons.

    Declaration

    Objective-C

    + (nonnull instancetype)multiPolygonWithPolygons:
        (nonnull NSArray<MGLPolygon *> *)polygons;

    Swift

    convenience init(polygons: [MGLPolygon])

    Parameters

    polygons

    The array of polygons defining the shape.

    Return Value

    A new multipolygon object.