Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
#877 - Adding logic to hide / make visible pins that should no longer…
Browse files Browse the repository at this point in the history
… appear on the screen after a map move
  • Loading branch information
bleege committed Mar 3, 2015
1 parent 4de7e8c commit b5f84e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/app/MBXViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down

0 comments on commit b5f84e6

Please sign in to comment.