diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/ios/MGLMapView.h | 8 | ||||
-rw-r--r-- | include/mbgl/ios/MGLTypes.h | 7 | ||||
-rw-r--r-- | include/mbgl/map/map.hpp | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index bf258ee82e..001e7aa678 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -118,6 +118,14 @@ IB_DESIGNABLE * @param animated Specify `YES` if you want the map view to animate scrolling and zooming to the new location or `NO` if you want the map to display the new location immediately. */ - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel animated:(BOOL)animated; +/** Returns the coordinate bounds visible in the receiver’s viewport. */ +- (MGLCoordinateBounds)visibleCoordinateBounds; + +/** Changes the receiver’s viewport to fit the given coordinate bounds, optionally animating the change. +* @param bounds The bounds that the viewport will show in its entirety. +* @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 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/ios/MGLTypes.h b/include/mbgl/ios/MGLTypes.h index 65d5e7846d..9213dafb37 100644 --- a/include/mbgl/ios/MGLTypes.h +++ b/include/mbgl/ios/MGLTypes.h @@ -28,6 +28,13 @@ typedef struct { CLLocationCoordinate2D ne; } MGLCoordinateBounds; +NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsMake(CLLocationCoordinate2D sw, CLLocationCoordinate2D ne) { + MGLCoordinateBounds bounds; + bounds.sw = sw; + bounds.ne = ne; + return bounds; +} + NS_ASSUME_NONNULL_END #pragma clang diagnostic push diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index e7474005e4..42ae72bb70 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -95,6 +95,7 @@ public: void setZoom(double zoom, Duration = Duration::zero()); double getZoom() const; void setLatLngZoom(LatLng latLng, double zoom, Duration = Duration::zero()); + void fitBounds(LatLngBounds bounds, Duration = Duration::zero()); void resetZoom(); double getMinZoom() const; double getMaxZoom() const; |