summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-05 10:23:09 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-13 17:26:53 -0800
commitfdff7901e2480cd683317eec2e490fc704612a0b (patch)
tree0dcac1286a3b094945716729f0056d7f79e241df /include
parentbab3935431ddec4d2762d2c010eac7530fd26856 (diff)
downloadqtlocation-mapboxgl-fdff7901e2480cd683317eec2e490fc704612a0b.tar.gz
[osx] Default callout view controller
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/osx/MGLMapView.h18
-rw-r--r--include/mbgl/osx/MGLMapViewDelegate.h3
2 files changed, 20 insertions, 1 deletions
diff --git a/include/mbgl/osx/MGLMapView.h b/include/mbgl/osx/MGLMapView.h
index bf7e4ee039..0a6a43ed12 100644
--- a/include/mbgl/osx/MGLMapView.h
+++ b/include/mbgl/osx/MGLMapView.h
@@ -374,6 +374,22 @@ IB_DESIGNABLE
@param annotation The annotation object to deselect. */
- (void)deselectAnnotation:(id <MGLAnnotation>)annotation;
+/** A common view controller for managing a callout popover’s content view.
+
+ Like any instance of NSPopover, an annotation callout manages its contents
+ with a view controller. The annotation object is the view controller’s
+ represented object. This means that you can bind controls in the view
+ controller’s content view to KVO-compliant properties of the annotation
+ object, such as -title and -subtitle.
+
+ This property defines a common view controller that is used for every
+ annotation’s callout view. If you set this property to `nil`, a default
+ view controller will be used that manages a simple title label and subtitle
+ label. If you need distinct view controllers for different annotations, the
+ map view’s delegate should implement
+ -mapView:calloutViewControllerForAnnotation: instead. */
+@property (nonatomic, strong, null_resettable) IBOutlet NSViewController *calloutViewController;
+
#pragma mark Finding annotations
/** @name Finding Annotations */
@@ -482,7 +498,7 @@ IB_DESIGNABLE
/** The options that determine which debugging aids are shown on the map.
These options are all disabled by default and should remain disabled in
- released software. */
+ released software for performance and aesthetic reasons. */
@property (nonatomic) MGLMapDebugMaskOptions debugMask;
@end
diff --git a/include/mbgl/osx/MGLMapViewDelegate.h b/include/mbgl/osx/MGLMapViewDelegate.h
index cea7f7952e..eece606c39 100644
--- a/include/mbgl/osx/MGLMapViewDelegate.h
+++ b/include/mbgl/osx/MGLMapViewDelegate.h
@@ -186,6 +186,9 @@ NS_ASSUME_NONNULL_BEGIN
controller’s content view to KVO-compliant properties of the annotation
object, such as -title and -subtitle.
+ If each annotation should have an identical callout, you can set the
+ MGLMapView instance’s -setCalloutViewController: method instead.
+
@param mapView The map view that is requesting a callout view controller.
@param annotation The object representing the annotation.
@return A view controller for the given annotation. */