From b5f84e682fd2e37def9916b69e080211a2624786 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Tue, 3 Mar 2015 14:51:14 -0600 Subject: [PATCH] #877 - Adding logic to hide / make visible pins that should no longer appear on the screen after a map move --- ios/app/MBXViewController.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm index 2668c6d2ddf..3c116528433 100644 --- a/ios/app/MBXViewController.mm +++ b/ios/app/MBXViewController.mm @@ -177,8 +177,12 @@ - (void)refresh:(CADisplayLink *)link CLLocationCoordinate2D c = CLLocationCoordinate2DMake([feature[@"geometry"][@"coordinates"][1] doubleValue], [feature[@"geometry"][@"coordinates"][0] doubleValue]); CGPoint p = [self.mapView convertCoordinate:c toPointToView:self.mapView]; + UIView *pin = (UIView *)feature[@"view"]; if (CGRectContainsPoint(self.mapView.bounds, p)) { - ((UIView *)feature[@"view"]).center = p; + pin.center = p; + [pin setHidden:NO]; + } else { + [pin setHidden:YES]; } }