summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPointCollection.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLPointCollection.mm')
-rw-r--r--platform/darwin/src/MGLPointCollection.mm13
1 files changed, 5 insertions, 8 deletions
diff --git a/platform/darwin/src/MGLPointCollection.mm b/platform/darwin/src/MGLPointCollection.mm
index f2bde38bc7..46b00b9a4d 100644
--- a/platform/darwin/src/MGLPointCollection.mm
+++ b/platform/darwin/src/MGLPointCollection.mm
@@ -8,10 +8,12 @@ NS_ASSUME_NONNULL_BEGIN
@implementation MGLPointCollection
{
- MGLCoordinateBounds _bounds;
+ MGLCoordinateBounds _overlayBounds;
std::vector<CLLocationCoordinate2D> _coordinates;
}
+@synthesize overlayBounds = _overlayBounds;
+
+ (instancetype)pointCollectionWithCoordinates:(const CLLocationCoordinate2D *)coords count:(NSUInteger)count
{
return [[self alloc] initWithCoordinates:coords count:count];
@@ -28,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
{
bounds.extend(mbgl::LatLng(coordinate.latitude, coordinate.longitude));
}
- _bounds = MGLCoordinateBoundsFromLatLngBounds(bounds);
+ _overlayBounds = MGLCoordinateBoundsFromLatLngBounds(bounds);
}
return self;
}
@@ -61,14 +63,9 @@ NS_ASSUME_NONNULL_BEGIN
std::copy(_coordinates.begin() + range.location, _coordinates.begin() + NSMaxRange(range), coords);
}
-- (MGLCoordinateBounds)overlayBounds
-{
- return _bounds;
-}
-
- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds
{
- return MGLLatLngBoundsFromCoordinateBounds(_bounds).intersects(MGLLatLngBoundsFromCoordinateBounds(overlayBounds));
+ return MGLCoordinateBoundsIntersectsCoordinateBounds(_overlayBounds, overlayBounds);
}
- (mbgl::Geometry<double>)geometryObject