-
Notifications
You must be signed in to change notification settings - Fork 1.3k
More ways to reshape an MGLMultiPoint #7251
Conversation
@1ec5, thanks for your PR! By analyzing this pull request, we identified @boundsj, @incanus and @jfirebaugh to be potential reviewers. |
31ec543
to
a1444e9
Compare
@@ -68,7 +68,7 @@ - (MGLCoordinateBounds)overlayBounds | |||
|
|||
- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds | |||
{ | |||
return MGLLatLngBoundsFromCoordinateBounds(_bounds).intersects(MGLLatLngBoundsFromCoordinateBounds(overlayBounds)); | |||
return MGLCoordinateBoundsIntersectsCoordinateBounds(_bounds, overlayBounds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach could also be used in MGLMultiPolyline(gon) intersectsOverlayBounds:
. In general, I wonder if it'd ever be useful to add an intersectsOverlay: <MGLOverlay>
API for all of these objects that conform to MGLOverlay
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I wonder if it'd ever be useful to add an
intersectsOverlay: <MGLOverlay>
API for all of these objects that conform toMGLOverlay
?
This SDK isn’t a general-purpose geometry library, so I think we should only add geometric methods as we need them or if we need them for parity with MapKit. In the future, we may want to spin out these geometry classes as part of a separate library that would serve as a more natural home for such geometry functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve updated MGLMultiPolygon and MGLMultiPolyline to use the simplified expression too.
Added the complete set of methods for mutating the vertices of an MGLMultiPoint. Also rewrote MGLMultiPoint documentation to refer to vertices instead of points.
a1444e9
to
441aeb2
Compare
Invalidate the bounds whenever the coordinates change, but don’t recompute the bounds until they’re requested. Simplified -intersectsOverlayBounds: for immutable overlay classes. Added a utility function for testing whether two MGLCoordinateBounds intersect, based on mbgl::LatLngBounds::intersects(). Removed unused color conversion code.
This paragraph is full of references to features that exist in MKOverlay but not MGLOverlay.
441aeb2
to
d1dd30a
Compare
Added the complete set of methods for mutating the vertices of an MGLMultiPoint. Invalidate
overlayBounds
whenever the coordinates change, but don’t recompute the bounds until they’re requested. Previously,-[MGLMultiPoint replaceCoordinatesInRange:withCoordinates:]
failed to recompute the bounds.Rewrote MGLMultiPoint documentation to refer to vertices instead of points. Removed a paragraph in MGLOverlay documentation that was full of references to features that exist in MKOverlay but not MGLOverlay.
Added a utility function for testing whether two
MGLCoordinateBounds
es intersect, based onmbgl::LatLngBounds::intersects()
. Removed unused color conversion code.Fixes #6583.
/cc @boundsj @incanus