FUIMapLegendLine

public struct FUIMapLegendLine

FUIMapLegendLine is a struct to represent the line in the Map Legend. The color of the line is determined by the backgroundColor set by the item.

Available in FUIMapLegendLine:

  • dashPattern: an array of NSNumber objects specifying the lenghts of line segments

  • dashPhase: a CGFloat describing how far into the dash pattern the line starts

Example Initialization and Configuration:


var valetItem = FUIMapLegendItem(title: "Valet")
valetItem.backgroundColor = UIColor.preferredFioriColor(forStyle: .map2)
let valetImage =  FUIAttributedImage(image: FUIIconLibrary.map.marker.walk.withRenderingMode(.alwaysTemplate))
valetImage.tintColor = .white
valetItem.icon = FUIMapLegendIcon(glyphImage: valetImage)
valetItem.line = FUIMapLegendLine(dashPattern: [10,8], dashPhase: 3.0)

var highTrafficPathItem = FUIMapLegendItem(title: "High Traffic Path")
highTrafficPathItem.backgroundColor = UIColor.preferredFioriColor(forStyle: .map4)
highTrafficPathItem.line = FUIMapLegendLine(dashPattern: [2,2], dashPhase: 0.0)

legend.items = [valetItem, highTrafficPathItem]

  • An array of NSNumber specifying the lenghts of line segments

    Declaration

    Swift

    public var dashPattern: [NSNumber]?
  • A CGFloat describing how far into the dash pattern the line starts

    Declaration

    Swift

    public var dashPhase: CGFloat?
  • An initializer to instantiate a FUIMapLegendLine with a dashPattern and dashPhase if provided

    Declaration

    Swift

    public init(dashPattern: [NSNumber]? = nil, dashPhase: CGFloat? = nil)