Closed TimothySealy closed 4 years ago
MGLPolygonStyleAnnotation
seems to have a constructor (declaration, definition) that accepts interior polygons (holes) as a separate parameter. Perhaps that is what you're looking for?
(instancetype)initWithCoordinates:(const CLLocationCoordinate2D *)coordinates count:(NSUInteger)count interiorPolygons:(NSArray<MGLPolygonFeature *> *)interiorPolygons
@skreborn Thanks for the clarification. I overlooked the interiorPolygons
parameter.
Happy to help. Should this issue be closed then?
Closing this up with two remarks:
According to the GeoJSON spec the coordinates of a Polygon "MUST be an array of linear ring coordinate arrays". This translates to an array of arrays of points. According to the example you have to pass an array of points to the
MGLPolygonStyleAnnotation
. It seems to be missing an additional (outer) array.Source: https://tools.ietf.org/html/rfc7946#section-3.1.6