[ios] Improve user location annotation documentation
- Add note to mapView:viewForAnnotation: delegate method. - Edit docs in iosapp's implementation of that delegate method.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user