From 98a2f6eca87781920635bd58d76004a333fd5fe1 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Fri, 28 Oct 2016 12:29:33 -0700 Subject: [PATCH 1/9] [wip] Use queryPointAnnotations to drive annotation view updates - Get sets of visible and offscreen annotations and update and enqueue as required - Query viewport adjusted if tilted (avoid apparent issue with queryPointAnnotations when the query box is larger than the actual viewport) - Add a small debugging display in iOS app to see annotations going in and out of the reuse queue --- platform/ios/app/MBXViewController.m | 22 +++++++ platform/ios/app/Main.storyboard | 62 ++++++++++++------- platform/ios/src/MGLMapView.mm | 93 ++++++++++++++++++---------- 3 files changed, 121 insertions(+), 56 deletions(-) diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index e8a78abff10..3b8975ddef2 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -102,11 +102,19 @@ @interface MBXViewController () + @property (nonatomic) IBOutlet MGLMapView *mapView; +@property (weak, nonatomic) IBOutlet UILabel *hudLabel; @property (nonatomic) NSInteger styleIndex; @property (nonatomic) BOOL debugLoggingEnabled; @property (nonatomic) BOOL customUserLocationAnnnotationEnabled; + +@end + +@interface MGLMapView (MBXViewController) + @property (nonatomic) BOOL usingLocaleBasedCountryLabels; +@property (nonatomic) NSDictionary *annotationViewReuseQueueByIdentifier; @end @@ -1506,9 +1514,23 @@ - (void)mapView:(MGLMapView *)mapView tapOnCalloutForAnnotation:(id - + + - + + + @@ -15,24 +17,35 @@ - + - - + + - + + + @@ -47,7 +60,7 @@