MaplyAnnotation
Objective-C
@interface MaplyAnnotation : NSObject
Swift
class MaplyAnnotation : NSObject
This object displays an annotation at a particular point and will track that point as the map or globe moves.
An annotation is used to point out some feature on the globe or map, typically that the user has tapped on. It’s a multi-part beast that may contain titles, subtitles, images, background views and such.
To add one, create the MaplyAnnotation and then call addAnnotation:forPoint:offset: on the MaplyBaseViewController.
The MaplyAnnotation is a wrapper around the SMCalloutView by Nick Farina. It exposes much of the functionality, but sets things up correctly and deals with moving the annotation around.
-
The minimum viewer height this annotation is visible at. This is viewer height above the globe or map. The annotation will only be visible if the user is above this height.
Declaration
Objective-C
@property (nonatomic) float minVis;
Swift
var minVis: Float { get set }
-
The maximum viewer height this annotation is visible at. This is viewer height above the globe or map. The annotation will only be visible if the user is below this height.
Declaration
Objective-C
@property (nonatomic) float maxVis;
Swift
var maxVis: Float { get set }
-
Set the popup’s title
Declaration
Objective-C
@property (nonatomic, strong) NSString *title;
Swift
var title: String! { get set }
-
Set the popup’s subtitle
Declaration
Objective-C
@property (nonatomic, strong) NSString *subTitle;
Swift
var subTitle: String! { get set }
-
If set, the (optional) accessory view on the left
Declaration
Objective-C
@property (nonatomic, strong) UIView *leftAccessoryView
Swift
var leftAccessoryView: UnsafeMutablePointer<Int32>! { get set }
-
If set, the (optional) accessory view on the right
Declaration
Objective-C
@property (nonatomic, strong) UIView *rightAccessoryView
Swift
var rightAccessoryView: UnsafeMutablePointer<Int32>! { get set }
-
If set, the custom title view containing whatever you like.
Declaration
Objective-C
@property (nonatomic, strong) UIView *titleView
Swift
var titleView: UnsafeMutablePointer<Int32>! { get set }
-
If set, the custom subtitle view containing whatever you put in there.
Declaration
Objective-C
@property (nonatomic, strong) UIView *subtitleView
Swift
var subtitleView: UnsafeMutablePointer<Int32>! { get set }
-
If set, a custom content view. Title, subtitle and views are ignored.
Declaration
Objective-C
@property (nonatomic, strong) UIView *contentView
Swift
var contentView: UnsafeMutablePointer<Int32>! { get set }
-
The location of the annotation
Declaration
Objective-C
@property (nonatomic, readonly) MaplyCoordinate loc;
Swift
var loc: MaplyCoordinate { get }
-
If set, we’ll reposition the globe or map to make the annotation visible. If the annotation would be off screen we would normally reposition the globe or map to make it visible. If this is et to false, we won’t.
Declaration
Objective-C
@property (nonatomic) _Bool repositionForVisibility;
Swift
var repositionForVisibility: Bool { get set }