KNMapRouteTheme
INFO
This English reference is based on Directions SDK 1.12.8-hotfix02. For the latest version, see the Korean reference.
Sets the route style. You can set the line thickness and color of the main route and alternative routes. You can also apply traffic congestion information and distinguish colors by congestion level.
Properties
| Name | Description | Type |
|---|---|---|
lineWidth | Line thickness of the main route (default: -1) | var lineWidth: Float |
strokeWidth | Stroke thickness of the main route (default: -1) | var strokeWidth: Float |
lineColors | Main route line colors by traffic condition: free-flowing, slightly congested, congested, heavily congested, unknown, or closed. Set a single color to use it for the entire line. | var lineColors: KNRouteColors |
strokeColors | Main route outline colors by traffic condition: free-flowing, slightly congested, congested, heavily congested, unknown, or closed. Set a single color to use it for the entire outline. | var strokeColors: KNRouteColors |
alterRouteInfo | Line and stroke thickness and color of alternative routes. Alternative routes are displayed in a single color. | var alterRouteInfo: KNAlterRouteInfo |
isVisibleRoute | Sets whether the route is visible (default: true) | var isVisibleRoute: Boolean |
isVisibleRGArrow | Whether direction arrows are displayed on the route. Hide them to make the route easier to inspect when viewing the entire route. (default: true) | var isVisibleRGArrow: Boolean |
Constructor
KNMapRouteTheme()
Creates a KNMapRouteTheme initialized with the preset route colors.
kotlin
fun makeRouteThemeWithMapView(mapView:KNMapView) {
mapView.routeTheme = KNMapRouteTheme()
}KNMapRouteTheme.driveDay()
Creates a daytime driving theme that uses a single color regardless of traffic conditions.
kotlin
fun makeRouteThemeToDriveDayWithMapView(mapView:KNMapView) {
mapView.routeTheme = KNMapRouteTheme.driveDay()
}KNMapRouteTheme.driveNight()
Creates a nighttime driving theme that uses a single color regardless of traffic conditions.
kotlin
fun makeRouteThemeToDriveNightWithMapView(mapView:KNMapView) {
mapView.routeTheme = KNMapRouteTheme.driveNight()
}KNMapRouteTheme.trafficDay()
Creates a daytime traffic theme that color-codes each route section by traffic conditions.
kotlin
fun makeRouteThemeToDriveDayWithMapView(mapView:KNMapView) {
mapView.routeTheme = KNMapRouteTheme.trafficDay()
}KNMapRouteTheme.trafficNight()
Creates a nighttime traffic theme that color-codes each route section by traffic conditions.
kotlin
fun makeRouteThemeToDriveDayWithMapView(mapView:KNMapView) {
mapView.routeTheme = KNMapRouteTheme.trafficNight()
}