Skip to content

Commit

Permalink
Merge pull request #66 from mapbox/maxim/65-use-vanishing-route-line
Browse files Browse the repository at this point in the history
Use vanishing route line in examples.
  • Loading branch information
MaximAlien authored Jul 23, 2020
2 parents 4b8c8c5 + dba128a commit b719a5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Navigation-Examples/Examples/Basic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class BasicViewController: UIViewController {
let navigationOptions = NavigationOptions(navigationService: navigationService)
let navigationViewController = NavigationViewController(for: route, routeOptions: options, navigationOptions: navigationOptions)
navigationViewController.modalPresentationStyle = .fullScreen
// Render part of the route that has been traversed with full transparency, to give the illusion of a disappearing route.
navigationViewController.mapView?.routeLineTracksTraversal = true

strongSelf.present(navigationViewController, animated: true, completion: nil)
}
Expand Down
7 changes: 4 additions & 3 deletions Navigation-Examples/Examples/Styled-UI-Elements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class CustomStyleUIElements: UIViewController {
let navigationOptions = NavigationOptions(styles: [CustomDayStyle(), CustomNightStyle()], navigationService: navigationService)
let navigationViewController = NavigationViewController(for: route, routeOptions: routeOptions, navigationOptions: navigationOptions)
navigationViewController.modalPresentationStyle = .fullScreen
// Render part of the route that has been traversed with full transparency, to give the illusion of a disappearing route.
navigationViewController.mapView?.routeLineTracksTraversal = true

strongSelf.present(navigationViewController, animated: true, completion: nil)
}
}
}
}



class CustomDayStyle: DayStyle {

private let backgroundColor = #colorLiteral(red: 0.06276176125, green: 0.6164312959, blue: 0.3432356119, alpha: 1)
Expand Down Expand Up @@ -86,6 +86,8 @@ class CustomDayStyle: DayStyle {
NavigationMapView.appearance().trafficModerateColor = #colorLiteral(red: 1, green: 0.6184511781, blue: 0, alpha: 1)
NavigationMapView.appearance().trafficSevereColor = #colorLiteral(red: 0.7458544374, green: 0.0006075350102, blue: 0, alpha: 1)
NavigationMapView.appearance().trafficUnknownColor = blueColor
// Customize the color that appears on the traversed section of a route
NavigationMapView.appearance().traversedRouteColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 0.5)
PrimaryLabel.appearance(whenContainedInInstancesOf: [InstructionsBannerView.self]).normalTextColor = primaryLabelColor
PrimaryLabel.appearance(whenContainedInInstancesOf: [StepInstructionsView.self]).normalTextColor = darkGrayColor
ResumeButton.appearance().backgroundColor = secondaryBackgroundColor
Expand All @@ -100,7 +102,6 @@ class CustomDayStyle: DayStyle {
}
}


class CustomNightStyle: NightStyle {

private let backgroundColor = #colorLiteral(red: 0.06276176125, green: 0.6164312959, blue: 0.3432356119, alpha: 1)
Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

A collection of examples showing off the [Mapbox Navigation SDK](https://github.com/mapbox/mapbox-navigation-ios).

![](https://user-images.githubusercontent.com/1058624/34502971-fac695b4-efca-11e7-9eb1-426f38bd89bf.gif)

![](https://user-images.githubusercontent.com/1496498/88307292-9db6a000-ccc0-11ea-9507-74c2e918dd98.gif)

## Installation

Expand Down

0 comments on commit b719a5f

Please sign in to comment.