MGLStyleAnnotation

@interface MGLStyleAnnotation : NSObject

An MGLStyleAnnotation represents a single point, line, or polygon shape that can be displayed on an MGLMapView within a geographical coordinate space.

Do not create instances of MGLStyleAnnotation directly. Instead, create an instance of MGLCircleStyleAnnotation, MGLLineStyleAnnotation, MGLPolygonStyleAnnotation, or MGLSymbolStyleAnnotation and use -[MGLAnnotationController addShape:] or -[MGLStyleAnnotationController addShapes:] to add an MGLStyleAnnotation to a map view.

  • The universally unique identifier of the style annotation.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull identifier;

    Swift

    var identifier: String { get }
  • If provided, the title string displayed if callouts are enabled.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSString *title;

    Swift

    var title: String? { get set }
  • If provided, the subtitle string displayed if callouts are enabled.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSString *subtitle;

    Swift

    var subtitle: String? { get set }
  • A Boolean value indicating whether the annotation view is draggable.

    If this property is set to YES, the user can drag the annotation after pressing and holding the view. The default value of this property is NO.

    Declaration

    Objective-C

    @property (getter=isDraggable, assign, readwrite, nonatomic) BOOL draggable;

    Swift

    var isDraggable: Bool { get set }