[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.
This commit is contained in:
Minh Nguyễn
2016-02-01 20:48:28 -08:00
committed by Minh Nguyễn
parent 909832624e
commit 7694eebe88
2 changed files with 12 additions and 15 deletions

View File

@@ -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.

View File

@@ -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];
}