Skip to content

Commit c02539f

Browse files
avi-c1ec5
authored andcommitted
Add UIAppearance property for map style font list to be used for intersection annotation labels. Set defaults to include a couple of fallbacks that should catch a larger number of glyphs than before.
1 parent ebe9bb5 commit c02539f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/MapboxNavigation/DayStyle.swift

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ open class DayStyle: Style {
172172
NavigationMapView.appearance().routeDurationAnnotationFontNames = UIFont.defaultNavigationSymbolLayerFontNames
173173
NavigationMapView.appearance().routeDurationAnnotationTextColor = #colorLiteral(red: 0.09803921569, green: 0.09803921569, blue: 0.09803921569, alpha: 1)
174174
NavigationMapView.appearance().routeDurationAnnotationSelectedTextColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
175+
NavigationMapView.appearance().intersectionAnnotationFontNames = ["DIN Pro Medium", "Noto Sans CJK JP Medium", "Arial Unicode MS Regular"]
175176
NavigationView.appearance().backgroundColor = #colorLiteral(red: 0.764706, green: 0.752941, blue: 0.733333, alpha: 1)
176177
NextBannerView.appearance().backgroundColor = #colorLiteral(red: 0.9675388083, green: 0.9675388083, blue: 0.9675388083, alpha: 1)
177178
NextBannerView.appearance(whenContainedInInstancesOf:[InstructionsCardContainerView.self]).backgroundColor = #colorLiteral(red: 0.9675388083, green: 0.9675388083, blue: 0.9675388083, alpha: 1)

Sources/MapboxNavigation/NavigationMapView.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ open class NavigationMapView: UIView {
117117
@objc dynamic public var intersectionAnnotationSelectedBackgroundColor: UIColor = .intersectionAnnotationSelectedBackgroundColor
118118
@objc dynamic public var intersectionAnnotationDefaultLabelColor: UIColor = .intersectionAnnotationDefaultLabelColor
119119
@objc dynamic public var intersectionAnnotationSelectedLabelColor: UIColor = .intersectionAnnotationSelectedLabelColor
120+
@objc dynamic public var intersectionAnnotationFontNames: [String] = ["DIN Pro Medium", "Noto Sans CJK JP Medium", "Arial Unicode MS Regular"]
120121

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

0 commit comments

Comments
 (0)