Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGLPolygonStyleAnnotation coordinates do not conform to the GeoJSON spec #70

Closed
TimothySealy opened this issue Jun 24, 2020 · 4 comments

Comments

@TimothySealy
Copy link

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

@skreborn
Copy link

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

@TimothySealy
Copy link
Author

@skreborn Thanks for the clarification. I overlooked the interiorPolygons parameter.

@skreborn
Copy link

Happy to help. Should this issue be closed then?

@TimothySealy
Copy link
Author

Closing this up with two remarks:

  1. I think it would be a good idea to clarify the usage of the interior polygons in the documentation.
  2. A constructor overload which only takes polygons (where the first polygon is the outer and the rest inner polygons) would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants