FUIMapLegendItem
public struct FUIMapLegendItem
FUIMapLegendItem is a struct to represent an entry in the Map Legend. A FUIMapLegendItem can be one of 4 types:
- icon: An item with a circular icon
- iconLine: An item with a circular icon and line
- line: An item with a line
- fill: An item with a filled polygon
Available:
title: aStringthat describes theFUIMapLegendItemtype: aFUIMapLegendItemTypedesignated for the item.backgroundColor: aUIColordisplayed as a backgroundColor for the itemtintColor: aUIColordisplayed as a tintColor for the itemicon: aFUIMapLegendIconfor the designated item.line: aFUIMapLegendLinefor the designated item.fillItem: aFUIMapLegendFillItemfor the designated item.
Example Initialization and Configuration:
// Type: .icon
var venueItem = FUIMapLegendItem(title: "Self Service")
venueItem.backgroundColor = UIColor.preferredFioriColor(forStyle: .map1)
let venueImage = FUIAttributedImage(image: FUIIconLibrary.map.marker.venue.withRenderingMode(.alwaysTemplate))
venueImage.tintColor = .white
venueItem.icon = FUIMapLegendIcon(glyphImage: venueImage)
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)
let highActivityRegion = FUIMapLegendFillItem()
highActivityRegion.fillColor = UIColor.preferredFioriColor(forStyle: .map3)
highActivityRegion.borderColor = UIColor.preferredFioriColor(forStyle: .map3)
var highActivityRegionItem = FUIMapLegendItem(title: "High Activity Region")
highActivityRegionItem.fillItem = highActivityRegion
var highTrafficPathItem = FUIMapLegendItem(title: "High Traffic Path")
highTrafficPathItem.backgroundColor = UIColor.preferredFioriColor(forStyle: .map4)
highTrafficPathItem.line = FUIMapLegendLine(dashPattern: [2,2], dashPhase: 0.0)
legend.items = [highActivityRegionItem, valetItem, venueItem, highTrafficPathItem]
-
A
Stringthat describes theFUIMapLegendItemDeclaration
Swift
public var title: String -
An initializer that instantiates the
FUIMapLegendItemwith a given title. AllFUIMapLegendItemmust have a title.Declaration
Swift
public init(title: String) -
A
UIColordisplayed as a backgroundColor for the item. This will be the background color the marker and/or line.Declaration
Swift
public var backgroundColor: UIColor -
A
UIColordisplayed as a tintColor for the item.Declaration
Swift
public var tintColor: UIColor! { get set } -
A
FUIMapLegendIconfor the designated item if it exists.Declaration
Swift
public var icon: FUIMapLegendIcon? -
A
FUIMapLegendLinefor the designated item if it exists.Declaration
Swift
public var line: FUIMapLegendLine? -
A
FUIMapLegendFillItemfor the designated item if it exists.Declaration
Swift
public var fillItem: FUIMapLegendFillItem?