summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLCalloutView.h
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2018-04-23 10:44:02 -0400
committerFabian Guerra <fabian.guerra@mapbox.com>2018-04-23 10:44:02 -0400
commite08b6fe87f5824ab05a4cc67d9a76af5bb5ddd3b (patch)
tree886e10260bfa044f62943186ec837b9ccd02934c /platform/ios/src/MGLCalloutView.h
parent2bb785dad2489d04db179fa9cf65514640db0a96 (diff)
parenta45670cfb5752866b9c8130024a313944684c2db (diff)
downloadqtlocation-mapboxgl-e08b6fe87f5824ab05a4cc67d9a76af5bb5ddd3b.tar.gz
Merge branch 'release-boba' into masterupstream/fabian-merge-v4.0.0
# Conflicts: # circle.yml # include/mbgl/style/expression/let.hpp # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java # platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java # platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml # platform/android/gradle/dependencies.gradle # platform/android/src/example_custom_layer.cpp # platform/android/src/geojson/point.cpp # platform/darwin/src/NSPredicate+MGLAdditions.mm # platform/darwin/test/MGLExpressionTests.mm # platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec # platform/ios/Mapbox-iOS-SDK-symbols.podspec # platform/ios/Mapbox-iOS-SDK.podspec # platform/ios/app/MBXViewController.m # src/mbgl/renderer/layers/render_custom_layer.cpp # src/mbgl/style/conversion/filter.cpp # src/mbgl/style/expression/interpolate.cpp # src/mbgl/style/expression/value.cpp # test/style/filter.test.cpp
Diffstat (limited to 'platform/ios/src/MGLCalloutView.h')
-rw-r--r--platform/ios/src/MGLCalloutView.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/platform/ios/src/MGLCalloutView.h b/platform/ios/src/MGLCalloutView.h
index 0481a39680..689b159fd7 100644
--- a/platform/ios/src/MGLCalloutView.h
+++ b/platform/ios/src/MGLCalloutView.h
@@ -39,7 +39,14 @@ NS_ASSUME_NONNULL_BEGIN
Presents a callout view by adding it to `view` and pointing at the given rect
of `view`’s bounds. Constrains the callout to the bounds of the given view.
*/
-- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated;
+- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated __attribute__((unavailable("Use -presentCalloutFromRect:inView:constrainedToRect:animated: instead.")));
+
+
+/**
+ Presents a callout view by adding it to `view` and pointing at the given rect
+ of `view`’s bounds. Constrains the callout to the rect in the space of `view`.
+ */
+- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToRect:(CGRect)constrainedRect animated:(BOOL)animated;
/**
Dismisses the callout view.
@@ -49,6 +56,24 @@ NS_ASSUME_NONNULL_BEGIN
@optional
/**
+ If implemented, should provide margins to expand the rect the callout is presented from.
+
+ These are used to determine positioning. Currently only the top and bottom properties of the return
+ value are used. For example, `{ .top = -50.0, .left = -10.0, .bottom = 0.0, .right = -10.0 }` indicates
+ a 50 point margin above the presentation origin rect (and 10 point margins to the left and the right)
+ in which the callout is assumed to be displayed.
+
+ There are no assumed defaults for these margins, as they should be calculated from the callout that
+ is to be presented. For example, `SMCalloutView` generates the top margin from the callout height, but
+ the left and right margins from a minimum width that the callout should have.
+
+ @param rect Rect that the callout is presented from. This should be the same as the one passed in
+ `-[MGLCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:]`
+ @return `UIEdgeInsets` representing the margins. Values should be negative.
+ */
+- (UIEdgeInsets)marginInsetsHintForPresentationFromRect:(CGRect)rect NS_SWIFT_NAME(marginInsetsHintForPresentation(from:));
+
+/**
A Boolean value indicating whether the callout view should be anchored to
the corresponding annotation. You can adjust the callout view’s precise location by
overriding -[UIView setCenter:]. The callout view will not be anchored to the