FUICircleAnnotationView

open class FUICircleAnnotationView : MKAnnotationView

The FUICircleAnnotationView inherits from the MKAnnotationView and is presented as a circle annotation on the MKMapView. It is used to display annotation objects which have similar display effect as MKCircle object.

Example

  1. Add annotation objects to map let point1 = MKPointAnnotation() point1.coordinate = CLLocationCoordinate2D(latitude: 37.3318, longitude: -122.0312) let point2 = MKPointAnnotation() point2.coordinate = CLLocationCoordinate2D(latitude: 37.3988313, longitude: -122.1487375) let annotations = [point1 as MKAnnotation, point2 as MKAnnotation] mapView.addAnnotations(annotations)
  2. Set the circle annotation view in the mapView(_:viewFor:) method.
let reuseIdentifier = "DefaultCircleAnnotationView"
let view = mapView.dequeueReusableAnnotationView(withIdentifier: reuseIdentifier) as? FUICircleAnnotationView
?? FUICircleAnnotationView(annotation: editAnnotation, reuseIdentifier: reuseIdentifier, clusteringIdentifier: nil)
view.outerColor = UIColor.preferredFioriColor(forStyle: .primary1)
view.outerWidth = 2.0
view.innerColor = UIColor.preferredFioriColor(forStyle: .tintColorTapState)
view.circleRadius = 6.0
return view
  • The border color of the circle view.

    Declaration

    Swift

    open var outerColor: UIColor { get set }
  • The border width of the circle view.

    Declaration

    Swift

    open var outerWidth: CGFloat { get set }
  • The tint color of the circle view.

    Declaration

    Swift

    open var innerColor: UIColor { get set }
  • The radius of the circle view.

    Declaration

    Swift

    open var circleRadius: CGFloat { get set }
  • An initializer that instantiates a FUICircleAnnotationView.

    Declaration

    Swift

    public required init(annotation: MKAnnotation?, reuseIdentifier: String,
                         clusteringIdentifier: String?)

    Parameters

    annotation

    the annotation which supplies data for the view

    reuseIdentifier

    a string for reuse identifier

    clusteringIdentifier

    a string for clustering identifier

  • Restore all user-defined properties to default before resue.

    Declaration

    Swift

    open override func prepareForReuse()
  • Override the layer factory for this class to return a custom CALayer class.

    Declaration

    Swift

    override open class var layerClass: AnyClass { get }
  • Convenience accessor for setting zPosition.

    Declaration

    Swift

    open var stickyZPosition: CGFloat { get set }