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
: aString
that describes theFUIMapLegendItem
type
: aFUIMapLegendItemType
designated for the item.backgroundColor
: aUIColor
displayed as a backgroundColor for the itemtintColor
: aUIColor
displayed as a tintColor for the itemicon
: aFUIMapLegendIcon
for the designated item.line
: aFUIMapLegendLine
for the designated item.fillItem
: aFUIMapLegendFillItem
for 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
String
that describes theFUIMapLegendItem
Declaration
Swift
public var title: String
-
An initializer that instantiates the
FUIMapLegendItem
with a given title. AllFUIMapLegendItem
must have a title.Declaration
Swift
public init(title: String)
-
A
UIColor
displayed as a backgroundColor for the item. This will be the background color the marker and/or line.Declaration
Swift
public var backgroundColor: UIColor
-
A
UIColor
displayed as a tintColor for the item.Declaration
Swift
public var tintColor: UIColor! { get set }
-
A
FUIMapLegendIcon
for the designated item if it exists.Declaration
Swift
public var icon: FUIMapLegendIcon?
-
A
FUIMapLegendLine
for the designated item if it exists.Declaration
Swift
public var line: FUIMapLegendLine?
-
A
FUIMapLegendFillItem
for the designated item if it exists.Declaration
Swift
public var fillItem: FUIMapLegendFillItem?