aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2018-10-05 17:39:56 -0400
committerJulian Rex <julian.rex@mapbox.com>2018-10-06 00:58:40 -0400
commit10ca63bae419016c5406e2516ea15713c20ba8a6 (patch)
tree07aeb8779fab4b437582bd52df389b4cf7c4de0e
parentf3dc57372a6a6f0314c0f3568ecf2e81157b743f (diff)
[ios] Update docs
-rw-r--r--platform/ios/src/MGLMapView.h20
-rw-r--r--platform/ios/src/MGLMapViewDelegate.h6
2 files changed, 19 insertions, 7 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index bda7131e6..265af8650 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -1320,13 +1320,13 @@ MGL_EXPORT IB_DESIGNABLE
/**
Selects an annotation and displays its callout view.
- The `animated` parameter determines whether the map is panned to bring the
- annotation on-screen, specifically:
+ The `animated` parameter determines whether the selection is animated including whether the map is
+ panned to bring the annotation into view, specifically:
| `animated` parameter | Effect |
|------------------|--------|
- | `NO` | The annotation is selected, and the callout is presented. However the map is not panned to bring the annotation or callout onscreen.
- | `YES` | The annotation is selected, and the callout is presented. If the annotation is offscreen, the map is panned so that the annotation and its callout are brought just onscreen. The annotation is *not* centered within the viewport. |
+ | `NO` | The annotation is selected, and the callout is presented. However the map is not panned to bring the annotation or callout into view.
+ | `YES` | The annotation is selected, and the callout is presented. If the annotation is not visible or is partially visible, the map is panned so that the annotation and its callout are brought into view. The annotation is *not* centered within the viewport. |
Note that a selection initiated by a single tap gesture is always animated.
@@ -1339,6 +1339,18 @@ MGL_EXPORT IB_DESIGNABLE
- (void)selectAnnotation:(id <MGLAnnotation>)annotation animated:(BOOL)animated;
/**
+ Selects an annotation and displays its callout view.
+
+ Note that a selection initiated by a single tap gesture is always animated.
+
+ @param annotation The annotation object to select.
+ @param animated If `YES`, the annotation and callout view's selection and presentation are animated. This parameter does not control whether the map moves.
+ @param expose If `YES` and the annotation is not visible or is partially visible, the map is panned so that the annotation and its callout are brought into view. The annotation is *not* centered within the viewport.
+ */
+- (void)selectAnnotation:(id <MGLAnnotation>)annotation animated:(BOOL)animated expose:(BOOL)expose;
+
+
+/**
Deselects an annotation and hides its callout view.
@param annotation The annotation object to deselect.
diff --git a/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/src/MGLMapViewDelegate.h
index 40096619f..8b40110c4 100644
--- a/platform/ios/src/MGLMapViewDelegate.h
+++ b/platform/ios/src/MGLMapViewDelegate.h
@@ -459,9 +459,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (BOOL)mapView:(MGLMapView *)mapView shapeAnnotationIsEnabled:(MGLShape *)annotation;
-
/**
- Returns a Boolean value indicating whether the annotation should be moved on-screen
+ Returns a Boolean value indicating whether the annotation should be brought into view
in response to a single tap selection.
If the delegate does not implement this method, the default value is `YES`.
@@ -470,7 +469,8 @@ NS_ASSUME_NONNULL_BEGIN
@param mapView The map view that has selected the annotation.
@param annotation The object representing the shape annotation.
- @return A Boolean value indicating whether the annotation should be moved onscreen if it and its callout (if it has one) are offscreen.
+ @return A Boolean value indicating whether the annotation should be moved into view. This value
+ can be considered to be the same as the `expose` parameter passed to `-[MGLMapView selectAnnotation:animated:expose:]`
*/
- (BOOL)mapView:(MGLMapView *)mapView shouldExposeAnnotationInResponseToUserSelection:(id <MGLAnnotation>)annotation;