summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2016-08-25 17:43:42 -0400
committerJason Wray <jason@mapbox.com>2016-08-26 17:48:27 -0400
commit8dff7ab2f0fe1f2d1412e79c99285f1a389e6541 (patch)
treec66b9bb6f8c4722b7a842b4055dc1e8a71975171 /platform
parent018f39544276d469b24f98e2709b43ad75d7536f (diff)
downloadqtlocation-mapboxgl-8dff7ab2f0fe1f2d1412e79c99285f1a389e6541.tar.gz
[ios] Improve user location annotation documentation
- Add note to mapView:viewForAnnotation: delegate method. - Edit docs in iosapp's implementation of that delegate method.
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/app/MBXViewController.m16
-rw-r--r--platform/ios/src/MGLMapViewDelegate.h5
2 files changed, 14 insertions, 7 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index bd8230ea15..605d6b2da8 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -732,15 +732,17 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie
annotationView = [[MBXAnnotationView alloc] initWithReuseIdentifier:MBXViewControllerAnnotationViewReuseIdentifer];
annotationView.frame = CGRectMake(0, 0, 10, 10);
annotationView.backgroundColor = [UIColor whiteColor];
-
- // uncomment to make the annotation view draggable
- // also note that having two long press gesture recognizers on overlapping views (`self.view` & `annotationView`) will cause weird behaviour
- // comment out the pin dropping functionality in the handleLongPress: method in this class to make draggable annotation views play nice
+
+ // Note that having two long press gesture recognizers on overlapping
+ // views (`self.view` & `annotationView`) will cause weird behaviour.
+ // Comment out the pin dropping functionality in the handleLongPress:
+ // method in this class to make draggable annotation views play nice.
annotationView.draggable = YES;
- // uncomment to force annotation view to maintain a constant size when the map is tilted
- // by default, annotation views will shrink and grow as the move towards and away from the
- // horizon. Relatedly, annotations backed by GL sprites ONLY scale with viewing distance currently.
+ // Uncomment to force annotation view to maintain a constant size when
+ // the map is tilted. By default, annotation views will shrink and grow
+ // as they move towards and away from the horizon. Relatedly, annotations
+ // backed by GL sprites currently ONLY scale with viewing distance.
// annotationView.scalesWithViewingDistance = NO;
} else {
// orange indicates that the annotation view was reused
diff --git a/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/src/MGLMapViewDelegate.h
index 3ec7d0d58b..ea9933f870 100644
--- a/platform/ios/src/MGLMapViewDelegate.h
+++ b/platform/ios/src/MGLMapViewDelegate.h
@@ -273,6 +273,11 @@ NS_ASSUME_NONNULL_BEGIN
Touch frameworks. On the other hand, static annotation images use less memory
and draw more quickly than annotation views.
+ The user location annotation view can also be customized via this method. When
+ `annotation` is an instance of `MGLUserLocation` (or equal to the map view’s
+ `userLocation` property), return an instance of `MGLUserLocationAnnotationView`
+ (or a subclass thereof).
+
@param mapView The map view that requested the annotation view.
@param annotation The object representing the annotation that is about to be
displayed.