diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-01-07 21:32:10 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-01-07 21:32:10 -0800 |
commit | b6fca670896e6351a03916fd9fb646e1970d3ebe (patch) | |
tree | 4d6e8c2b316d42f892ba138aa83910e6527aa907 /include | |
parent | 6fcb9f4da12da595a82c933775d6608c5b0f4f23 (diff) | |
download | qtlocation-mapboxgl-b6fca670896e6351a03916fd9fb646e1970d3ebe.tar.gz |
[ios] Added some missing coordinate conversion methods
These methods were public in the OS X SDK but not here.
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/ios/MGLMapView.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 8a5ebef2a4..feb5c6d630 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -593,6 +593,28 @@ IB_DESIGNABLE - (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable UIView *)view; /** + Converts a rectangle in the given view’s coordinate system to a geographic + bounding box. + + @param rect The rectangle to convert. + @param view The view in whose coordinate system the rectangle is expressed. + @return The geographic bounding box coextensive with the given rectangle. + */ +- (MGLCoordinateBounds)convertRect:(CGRect)rect toCoordinateBoundsFromView:(nullable UIView *)view; + +/** + Converts a geographic bounding box to a rectangle in the given view’s + coordinate system. + + @param bounds The geographic bounding box to convert. + @param view The view in whose coordinate system the returned rectangle should + be expressed. If this parameter is `nil`, the returned rectangle is + expressed in the window’s coordinate system. If `view` is not `nil`, it must + belong to the same window as the map view. + */ +- (CGRect)convertCoordinateBounds:(MGLCoordinateBounds)bounds toRectToView:(nullable UIView *)view; + +/** Returns the distance spanned by one point in the map view's coordinate system at the given latitude and current zoom level. |