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 1763da3 commit 1ef5c18
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 @@ -169,6 +169,7 @@ open class DayStyle: Style {
NavigationMapView.appearance().alternativeTrafficUnknownColor = .alternativeTrafficUnknown
NavigationMapView.appearance().buildingDefaultColor = .defaultBuildingColor
NavigationMapView.appearance().buildingHighlightColor = .defaultBuildingHighlightColor
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 @@ -102,6 +102,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"]

@objc dynamic public var reducedAccuracyActivatedMode: Bool = false {
didSet {
Expand Down Expand Up @@ -1332,7 +1333,7 @@ open class NavigationMapView: UIView {
shapeLayer.layout?.textAllowOverlap = .constant(true)
shapeLayer.layout?.textJustify = .constant(.center)
shapeLayer.layout?.symbolZOrder = .constant(.auto)
shapeLayer.layout?.textFont = .constant(["DIN Pro Medium"])
shapeLayer.layout?.textFont = .constant(self.intersectionAnnotationFontNames)
shapeLayer.layout?.iconTextFitPadding = .constant([-4, 0, -3, 0])

style.addLayer(layer: shapeLayer, layerPosition: nil)
Expand Down

0 comments on commit 1ef5c18

Please sign in to comment.