Repository navigation
Add MGLPointCollection for GeoJSON multipoints - #6742
Conversation
|
@boundsj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ituaijagbone, @1ec5 and @rmnblm to be potential reviewers. |
1ec5
left a comment
There was a problem hiding this comment.
Also update the iOS and macOS changelogs to note that we fixed a bug in which feature querying returned abstract MGLMultiPointFeature objects for multipoint features; now it returns concrete MGLPointCollectionFeature objects instead.
There was a problem hiding this comment.
Revert this class’s comment to what it used to say.
There was a problem hiding this comment.
Should this class conform to MGLOverlay? (Intriguingly, we could have this class be a subclass of MGLMultiPoint, in order to share mutable coordinate code. But best to leave this as is for now.)
There was a problem hiding this comment.
Add a getter for the coordinates.
There was a problem hiding this comment.
Add a public initializer to go with the factory method.
There was a problem hiding this comment.
We don't have public initializers for any of the other shapes. Why add one in this case? Especially since MGLPointCollection currently can't be added to the map as an since there is no representation for that sort of annotation in mbgl core.
There was a problem hiding this comment.
Interesting, OK, whatever's consistent.
There was a problem hiding this comment.
Interesting, OK, whatever's consistent.
There was a problem hiding this comment.
Make the same change on the macOS side.
|
Fixes #6764 |
|
@1ec5 @friedbunny I still need to add the changelog entries but this is ready for review (thanks @1ec5 for the early review!) |
There was a problem hiding this comment.
@1ec5 I'm thinking about mentioning that this class is really only useful as an MGLPointCollectionFeature in an MGLGeoJSONSource. What do you think?
This moves the method that creates a "multi point" object in the GeoJSON sense to MGLPointCollection. The methods for creating mbgl::Feature and GeoJSON dictionary representations are also moved.
- Add WIP description for MGLPointCollection class - Change the name of MGLPointCollectionFeature description - Update MGLMultiPoint class description - Add NSObject description method to MGLPointCollection - Update jazzy yml rename of multipoint feature to point collection feature
We don't want MGLMultiPoints to be used directly. Again.
This matches the multipoint implementation
This updates the iOS and macOS annotation adding logic so that unwanted shapes really are avoided. Previously the combined OR conditions meant that an annotation had to logically be NOT a kind of all three types so the check always let the annotation slip through. This also expands the guard to deflect the recently introduced MGLPointCollection. This removes the check in the macOS SDK for multipoints as annotations for the polygon and polyline case so this logic now matches iOS. Finally, this fixes up the macOS project so that MGLPointCollection is linked correctly.
a777c16 to
c6288a7
Compare
1ec5
left a comment
There was a problem hiding this comment.
A few minor things, but this is looking great.
| #import "MGLShape.h" | ||
|
|
||
| /** | ||
| The `MGLPointCollection` class is used to define an array of coordinates. |
There was a problem hiding this comment.
Emphasize that these coordinates are disconnected (as opposed to MGLMultiPoint).
| @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. |
There was a problem hiding this comment.
s/multipoint/point collection/
| @note `MGLMultiPolyline`, `MGLMultiPolygon`, `MGLShapeCollection`, and | ||
| `MGLPointCollection` objects cannot be added to the map view at this time. | ||
| Any multipoint, multipolyline, multipolygon, shape collection or point | ||
| collection, object that is specified is silently ignored. |
There was a problem hiding this comment.
Nit: remove comma after "collection".
|
Thanks @1ec5! I think this is ready to go. |
Fixes #5201
Context from #5201 (comment)