diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-12-06 23:36:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-06 23:36:55 -0800 |
commit | 4c2aec2355b166174bd062b1d27f8f89fad6008c (patch) | |
tree | 5d840c4b0d79dc401fc84ffad70ef0d2478bc524 /platform/darwin/src/MGLGeometry.h | |
parent | 9f9422deb808ff5f77aa640c8222207fa6456e04 (diff) | |
download | qtlocation-mapboxgl-4c2aec2355b166174bd062b1d27f8f89fad6008c.tar.gz |
[ios, macos] More ways to reshape an MGLMultiPoint (#7251)
* [ios, macos] Completed API for mutating multipoints
Added the complete set of methods for mutating the vertices of an MGLMultiPoint. Also rewrote MGLMultiPoint documentation to refer to vertices instead of points.
* [ios, macos] Removed inaccurate MGLOverlay commentary
This paragraph is full of references to features that exist in MKOverlay but not MGLOverlay.
* [ios, macos] Lazily compute multipoint bounds
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.
Diffstat (limited to 'platform/darwin/src/MGLGeometry.h')
-rw-r--r-- | platform/darwin/src/MGLGeometry.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLGeometry.h b/platform/darwin/src/MGLGeometry.h index e2a4d818b9..8e36b86d96 100644 --- a/platform/darwin/src/MGLGeometry.h +++ b/platform/darwin/src/MGLGeometry.h @@ -62,6 +62,14 @@ NS_INLINE BOOL MGLCoordinateBoundsEqualToCoordinateBounds(MGLCoordinateBounds bo bounds1.ne.longitude == bounds2.ne.longitude); } +/** Returns `YES` if the two coordinate bounds intersect. */ +NS_INLINE BOOL MGLCoordinateBoundsIntersectsCoordinateBounds(MGLCoordinateBounds bounds1, MGLCoordinateBounds bounds2) { + return (bounds1.ne.latitude > bounds2.sw.latitude && + bounds1.sw.latitude < bounds2.ne.latitude && + bounds1.ne.longitude > bounds2.sw.longitude && + bounds1.sw.longitude < bounds2.ne.longitude); +} + /** Returns `YES` if the coordinate is within the coordinate bounds. */ NS_INLINE BOOL MGLCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate, MGLCoordinateBounds bounds) { return (coordinate.latitude >= bounds.sw.latitude && |