AWFAnnotationStyle

Objective-C

@interface AWFAnnotationStyle : AWFMapItemStyle

Swift

class AWFAnnotationStyle : AWFMapItemStyle

An AWFAnnotationStyle object provides the style specifications to be used for an annotation’s representation on a map.

  • Radius of the annotation’s shape.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat radius;

    Swift

    var radius: CGFloat { get set }
  • Image to apply to the annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIImage *image;

    Swift

    var image: UIImage? { get set }
  • The inset or outset margins for the rectangle around the annotation’s image.

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets imageEdgeInsets;

    Swift

    var imageEdgeInsets: UIEdgeInsets { get set }
  • A Boolean value indicating whether the specified image should be scaled down to fit within the radius value.

    The default value is YES, meaning the image will be scaled down as needed.

    Declaration

    Objective-C

    @property (nonatomic) BOOL resizesImageToBounds;

    Swift

    var resizesImageToBounds: Bool { get set }
  • A Boolean value indicating whether the point should be displayed.

    This value is typically used when providing an image to display for the annotation. If this value is YES and an image is also specified, then the image will appear over the annotation’s point. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showsPoint;

    Swift

    var showsPoint: Bool { get set }
  • Whether or not the annotation should be filled.

    Declaration

    Objective-C

    @property (nonatomic, getter=isFilled) BOOL filled;

    Swift

    var isFilled: Bool { get set }
  • The offset (in pixels) relative to the annotation coordinate at which to display the annotation view.

    Declaration

    Objective-C

    @property (nonatomic) CGPoint centerOffset;

    Swift

    var centerOffset: CGPoint { get set }
  • A Boolean value indicating whether the annotation is enabled.

    See

    MKAnnotation

    Declaration

    Objective-C

    @property (nonatomic, getter=isEnabled) BOOL enabled;

    Swift

    var isEnabled: Bool { get set }
  • A block that is used to format the callout content when presenting.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) AWFCalloutFormatter calloutFormatter;

    Swift

    var calloutFormatter: AWFCalloutFormatter? { get }
  • A Boolean value indicating whether the annotation view is able to display extra information in a callout bubble.

    See

    MKAnnotation

    Declaration

    Objective-C

    @property (nonatomic) BOOL canShowCallout;

    Swift

    var canShowCallout: Bool { get set }
  • A Boolean value indicating whether the annotation is animatable.

    Declaration

    Objective-C

    @property (nonatomic, getter=isAnimatable) BOOL animatable;

    Swift

    var isAnimatable: Bool { get set }
  • A Boolean value indicating whether the view associated with the annotation should be animated.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldAnimate;

    Swift

    var shouldAnimate: Bool { get set }
  • The number of seconds to display the annotation before hiding when part of a weather map animation.

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval animationSecondsToHideAfterDisplaying;

    Swift

    var animationSecondsToHideAfterDisplaying: TimeInterval { get set }
  • The initial transform to apply to the annotation view when animating. Default is CATransform3DIdentity.

    Declaration

    Objective-C

    @property (nonatomic) CATransform3D transform;

    Swift

    var transform: CATransform3D { get set }
  • The CAAnimation instance to use when presenting the annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) CAAnimation *inAnimation;

    Swift

    var inAnimation: CAAnimation? { get set }
  • The CAAnimation instance to use when dismissing the annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) CAAnimation *outAnimation;

    Swift

    var outAnimation: CAAnimation? { get set }
  • The image to display for the annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIImage *icon;

    Swift

    var icon: UIImage? { get set }
  • Initializes and returns a style object with the specified style options.

    Declaration

    Objective-C

    + (nonnull instancetype)styleWithRadius:(CGFloat)radius
                                  fillColor:(nonnull UIColor *)fillColor
                                strokeColor:(nonnull UIColor *)strokeColor
                                strokeWidth:(CGFloat)strokeWidth;

    Swift

    convenience init(radius: CGFloat, fill fillColor: UIColor, stroke strokeColor: UIColor, strokeWidth: CGFloat)

    Parameters

    radius

    The radius of the annotation.

    fillColor

    The color used to fill the annotation.

    strokeColor

    The color used to stroke the annotation.

    strokeWidth

    The line width of the annotation’s stroke.

    Return Value

    The initialized style object.

  • Initializes and returns a style object with the specified image.

    Declaration

    Objective-C

    + (nonnull instancetype)styleWithImage:(nonnull UIImage *)image;

    Swift

    convenience init(image: UIImage)

    Parameters

    image

    The image to use for the annotation.

    Return Value

    The initialized style object.

  • Generates an image representation of the annotation’s view based on the style specifications.

    Declaration

    Objective-C

    - (nullable UIImage *)imageFromStyle;

    Swift

    func imageFromStyle() -> UIImage?

    Return Value

    An image representation of the annotation.

  • Presents the annotation view by applying the inAnimation animation to the specified layer.

    Declaration

    Objective-C

    - (void)applyPresentationAnimationToLayer:(nonnull CALayer *)layer;

    Swift

    func applyPresentationAnimation(to layer: CALayer)

    Parameters

    layer

    The layer to apply the animation to

  • Dismisses the annotation view by applying the outAnimation animation to the specified layer.

    Declaration

    Objective-C

    - (void)applyDismissAnimationToLayer:(nonnull CALayer *)layer;

    Swift

    func applyDismissAnimation(to layer: CALayer)

    Parameters

    layer

    The layer to apply the animation to

  • Returns the default annotation style for the specified layer type. This may return a single instance of AWFAnnotationStyle, or if there are multiple styles associated with a layer type this method will return an instance of AWFGroupedStyle.

    Declaration

    Objective-C

    + (nullable id)defaultStyleForLayerType:(nonnull AWFMapLayer)layerType;

    Swift

    class func defaultStyle(forLayerType layerType: AWFMapLayer) -> Any?

    Parameters

    layerType

    The layer type to return the default style for

    Return Value

    Either an instance of AWFAnnotationStyle or AWFGroupedStyle