Skip to content

Commit

Permalink
Add UIAppearance property for map style font list to be used for inte…
Browse files Browse the repository at this point in the history
…rsection annotation labels. Set defaults to include a couple of fallbacks that should catch a larger number of glyphs than before.
  • Loading branch information
avi-c authored and 1ec5 committed May 17, 2022
1 parent ebe9bb5 commit c02539f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/MapboxNavigation/DayStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ open class DayStyle: Style {
NavigationMapView.appearance().routeDurationAnnotationFontNames = UIFont.defaultNavigationSymbolLayerFontNames
NavigationMapView.appearance().routeDurationAnnotationTextColor = #colorLiteral(red: 0.09803921569, green: 0.09803921569, blue: 0.09803921569, alpha: 1)
NavigationMapView.appearance().routeDurationAnnotationSelectedTextColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
NavigationMapView.appearance().intersectionAnnotationFontNames = ["DIN Pro Medium", "Noto Sans CJK JP Medium", "Arial Unicode MS Regular"]
NavigationView.appearance().backgroundColor = #colorLiteral(red: 0.764706, green: 0.752941, blue: 0.733333, alpha: 1)
NextBannerView.appearance().backgroundColor = #colorLiteral(red: 0.9675388083, green: 0.9675388083, blue: 0.9675388083, alpha: 1)
NextBannerView.appearance(whenContainedInInstancesOf:[InstructionsCardContainerView.self]).backgroundColor = #colorLiteral(red: 0.9675388083, green: 0.9675388083, blue: 0.9675388083, alpha: 1)
Expand Down
3 changes: 2 additions & 1 deletion Sources/MapboxNavigation/NavigationMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ open class NavigationMapView: UIView {
@objc dynamic public var intersectionAnnotationSelectedBackgroundColor: UIColor = .intersectionAnnotationSelectedBackgroundColor
@objc dynamic public var intersectionAnnotationDefaultLabelColor: UIColor = .intersectionAnnotationDefaultLabelColor
@objc dynamic public var intersectionAnnotationSelectedLabelColor: UIColor = .intersectionAnnotationSelectedLabelColor
@objc dynamic public var intersectionAnnotationFontNames: [String] = ["DIN Pro Medium", "Noto Sans CJK JP Medium", "Arial Unicode MS Regular"]

/**
A pending user location coordinate, which is used to calculate the bottleneck distance for
Expand Down Expand Up @@ -2260,7 +2261,7 @@ open class NavigationMapView: UIView {
shapeLayer.textAllowOverlap = .constant(true)
shapeLayer.textJustify = .constant(.center)
shapeLayer.symbolZOrder = .constant(.auto)
shapeLayer.textFont = .constant(["DIN Pro Medium"])
shapeLayer.textFont = .constant(self.intersectionAnnotationFontNames)
shapeLayer.iconTextFitPadding = .constant([-4, 0, -3, 0])
shapeLayer.symbolSortKey = .expression(Exp(.get) { "sortOrder" })

Expand Down

0 comments on commit c02539f

Please sign in to comment.