summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-06-26 14:27:44 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-06-26 21:46:15 -0700
commitac2ad993a594e309362787e0697ff1727b799e8e (patch)
tree8347096c4f0c0de64bfadb514387b44d27427f66 /include
parent7b22caddd0bb58677cc29a29c005bec621368d4b (diff)
downloadqtlocation-mapboxgl-ac2ad993a594e309362787e0697ff1727b799e8e.tar.gz
Fit to coordinates
Whoever determined the boundaries of the District of Columbia did not have fit-to-bounds implementations in mind. With this change, shapes that are not unrotated rectangles fit much, much better.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/ios/MGLMapView.h7
-rw-r--r--include/mbgl/map/map.hpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h
index d426fd0869..346bb62257 100644
--- a/include/mbgl/ios/MGLMapView.h
+++ b/include/mbgl/ios/MGLMapView.h
@@ -134,6 +134,13 @@ IB_DESIGNABLE
* @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds. */
- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
+/** Changes the receiver’s viewport to fit all of the given coordinates and optionally some additional padding on each side.
+* @param coordinates The coordinates that the viewport will show.
+* @param count The number of coordinates. This number must not be greater than the number of elements in `coordinates`.
+* @param insets The minimum padding (in screen points) that will be visible around the given coordinate bounds.
+* @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds. */
+- (void)setVisibleCoordinates:(CLLocationCoordinate2D *)coordinates count:(NSUInteger)count edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
+
/** The heading of the map (measured in degrees) relative to true north.
*
* The value `0` means that the top edge of the map view corresponds to true north. The value `90` means the top of the map is pointing due east. The value `180` means the top of the map points due south, and so on. */
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index abd93fad6a..6fd5e96063 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -100,6 +100,7 @@ public:
double getZoom() const;
void setLatLngZoom(LatLng latLng, double zoom, Duration = Duration::zero());
void fitBounds(LatLngBounds bounds, EdgeInsets padding, Duration duration = Duration::zero());
+ void fitBounds(AnnotationSegment segment, EdgeInsets padding, Duration duration = Duration::zero());
void resetZoom();
double getMinZoom() const;
double getMaxZoom() const;