summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-02-01 20:48:28 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-02-01 20:55:55 -0800
commit7694eebe8837f45540687aea65301a83243d74f7 (patch)
treefb2a8c5ff8fbcea93cc0e856d1f8e1a9f320e92c
parent909832624e3c3afa28f98e109c5bae188a4f3120 (diff)
downloadqtlocation-mapboxgl-7694eebe8837f45540687aea65301a83243d74f7.tar.gz
[ios] Renamed -showAnnotations:withEdgeInsets:animated:
Renamed -showAnnotations:withEdgeInsets:animated: to -showAnnotations:edgePadding:animated: for consistency with other methods. Reworded documentation comments to avoid hard-coding too many specifics that are prone to getting outdated.
-rw-r--r--include/mbgl/ios/MGLMapView.h19
-rw-r--r--platform/ios/src/MGLMapView.mm8
2 files changed, 12 insertions, 15 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h
index 5a94ab2f44..dc03c13f7b 100644
--- a/include/mbgl/ios/MGLMapView.h
+++ b/include/mbgl/ios/MGLMapView.h
@@ -597,11 +597,10 @@ IB_DESIGNABLE
/**
Sets the visible region so that the map displays the specified annotations.
- Calling this method updates the value in the visibleCoordinateBounds property
- and potentially other properties to reflect the new map region. Defaults to
- insetting the annotation bounds by 100,100,100,100, or if map is smaller than
- 200x200 in either dimension, sets the insets to 20% of that dimmension on
- either side.
+ Calling this method updates the value in the `visibleCoordinateBounds` property
+ and potentially other properties to reflect the new map region. A small amount
+ of padding is reserved around the edges of the map view. To specify a different
+ amount of padding, use the `-showAnnotations:edgePadding:animated:` method.
@param annotations The annotations that you want to be visible in the map.
@param animated `YES` if you want the map region change to be animated, or `NO`
@@ -611,18 +610,18 @@ IB_DESIGNABLE
/**
Sets the visible region so that the map displays the specified annotations with
- custom insets.
+ the specified amount of padding on each side.
Calling this method updates the value in the visibleCoordinateBounds property
- and potentially other properties to reflect the new map region. It allows for
- the customization of the UIEdgeInsets that determine the resultant viewport.
+ and potentially other properties to reflect the new map region.
@param annotations The annotations that you want to be visible in the map.
- @param edgeInsets Custom edge insets to contain the the annotations within.
+ @param insets The minimum padding (in screen points) around the edges of the
+ map view to keep clear of annotations.
@param animated `YES` if you want the map region change to be animated, or `NO`
if you want the map to display the new region immediately without animations.
*/
-- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations withEdgeInsets:(UIEdgeInsets)edgeInsets animated:(BOOL)animated;
+- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
/**
A camera representing the current viewpoint of the map.
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index beb0438591..c9d3145e2e 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -2958,12 +2958,10 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
UIEdgeInsets edgeInsets = UIEdgeInsetsMake(yPadding, xPadding, yPadding, xPadding);
- [self showAnnotations:annotations
- withEdgeInsets:edgeInsets
- animated:animated];
+ [self showAnnotations:annotations edgePadding:edgeInsets animated:animated];
}
-- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations withEdgeInsets:(UIEdgeInsets)edgeInsets animated:(BOOL)animated
+- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated
{
if ( ! annotations || ! annotations.count) return;
@@ -2982,7 +2980,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
}
[self setVisibleCoordinateBounds:MGLCoordinateBoundsFromLatLngBounds(bounds)
- edgePadding:edgeInsets
+ edgePadding:insets
animated:animated];
}