KNNaviView
INFO
This English reference is based on Directions SDK with UI 1.12.12. For the latest version, see the Korean reference.
- Inherits from: UIView
- Declared in: KNNaviView.h
A class that composes the basic guidance screen. When you need a driving guidance screen outside of the Kakao Navi service, you can compose the guidance screen using the minimum elements required for driving guidance. When initializing KNNaviView, you can set information used in the user interface, such as sndVolume and useDarkMode.
TIP
However, the entered information values are not saved separately, and the default values from when KNNaviView is created are used.
For sndVolume, you can receive the changed value (0 to 1.0f) through a callback when the route guidance volume is set in the app.
Properties
| Name | Description | Type |
|---|---|---|
mapView | Map view displayed on the guidance screen | @property (nonatomic, readonly) KNNaviMapView* _Nonnull mapView; |
curDirView | View that displays the first route guidance information | @property (nonatomic, readonly) KNCurDirectionView* _Nonnull curDirView; |
nextDirView | View that displays the second route guidance information | @property (nonatomic, readonly) KNNextDirectionView* _Nonnull nextDirView |
stateDelegate | Delegate that represents the state of KNNaviView | @property (nonatomic, weak) id<KNNaviView_StateDelegate>_Nullable stateDelegate |
guideStateDelegate | Delegate that represents the guide state of KNNaviView | @property (nonatomic, weak) id<KNNaviView_GuideStateDelegate>_Nullable guideStateDelegate |
Methods
initWithGuidance:trip:routeOption:avoidOption
Creates naviView.
- (id) initWithGuidance: (KNGuidance *_Nonnull) aGuidance
trip: (KNTrip *_Nullable) aTrip
routeOption: (KNRoutePriority) aRouteOption
avoidOption: (KNRouteAvoidOption) aAvoidOptionParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aTrip | Route to use for driving |
aRouteOption | Items to prioritize when choosing a route during route guidance |
aAvoidOption | Sections to avoid in the route |
useDarkMode
Sets night mode.
- (void) useDarkMode: (BOOL) aModesndVolume
Sets the sound volume.
- (void) sndVolume: (float) aVolumeParameters
| Name | Description |
|---|---|
aVolume | Volume setting (range: 0–1.0f) |
fuelType
Sets the fuel used by the vehicle.
- (void) fuelType: (KNCarFuel) aFuelTypecarType
Changes the vehicle type.
- (void) carType: (KNCarType) aCarTypereleaseView
Releases naviView.
- (void) releaseViewguidanceGuideStarted
Starts route guidance. Delivers the content of guidanceGuideStated(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidanceGuideStarted: (KNGuidance *_Nonnull) aGuidanceParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
guidanceCheckingRouteChange
Detects a change in the route. Called when the route is recalculated due to traffic changes or route deviation, or when the user reroutes. Delivers the content of guidanceCheckingRouteChange(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidanceCheckingRouteChange: (KNGuidance *_Nonnull) aGuidanceParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
guidanceRouteUnchanged
Keeps the existing route. Called when there is no route change after detecting a traffic change, or when the newly requested route due to a traffic condition change is identical to the existing route. Delivers the content of guidanceRouteUnchanged(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidanceCheckingRouteChange: (KNGuidance *_Nonnull) aGuidanceParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
guidanceRouteUnchangedWithError
Returns an error message when a route request fails. Delivers the content of guidanceRouteUnchangedWithError(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
routeUnchangedWithError: (KNError *_Nonnull) aErrorParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aError | Route request failure error |
guidanceOutOfRoute
Deviates from the existing route. Delivers the content of guidanceOutOfRoute(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidanceOutOfRoute: (KNGuidance *_Nonnull) aGuidanceParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
guidanceRouteChanged
Delivers a route change. Among multiple routes, the first route is the driving route and the rest become alternative routes. Delivers the content of guidanceRouteChanged(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidanceOutOfRoute: (KNGuidance *_Nonnull) aGuidanceParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
guidanceGuideEnded:isShowDriveResultDialog
Ends route guidance. Delivers the content of guidanceGuideEnded(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView. You can also set whether to display a popup message that announces the end of route guidance.
- (void) guidanceGuideEnded: (KNGuidance *_Nonnull) aGuidance
isShowDriveResultDialog: (BOOL) aIsShow;Parameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aIsShow | Whether to display the route guidance end popup message |
guidance:didUpdateRoutes:multiRouteInfo
Changes the existing routes. Delivers the content of guidanceDidUpdateRoutes(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
didUpdateRoutes: (NSArray<KNRoute*> *) aRoutes
multiRouteInfo: (KNMultiRouteInfo *_Nullable) aMultiRouteInfoParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aRoutes | List of route information |
aMultiRouteInfo | Alternative route information |
guidance:didUpdateLocation
Updates the location information. Delivers the content of guidanceDidUpdateLocation(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
didUpdateLocation: (KNGuide_Location *_Nonnull) aLocationGuideParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aLocationGuide | Location information |
guidance:didUpdateRouteGuide
Delivered when one or more of the detailed items of the route guidance information change. Delivers the content of guidanceDidUpdateRouteGuide(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
didUpdateRouteGuide: (KNGuide_Route *_Nonnull) aRouteGuideParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aRouteGuide | Route guidance information |
guidance:didUpdateSafetyGuide
Delivered when one or more of the detailed items of the safe driving guidance information change. Delivers the content of guidanceDidUpdateSafetyGuide(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
didUpdateSafetyGuide: (KNGuide_Safety *_Nonnull) aSafetyGuideParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aSafetyGuide | Safe driving guidance information |
guidance:didUpdateAroundSafeties
Delivers surrounding safe driving information data. Delivers the content of guidanceDidUpdateAroundSafeties(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
didUpdateAroundSafeties: (NSArray<__kindofKNSafety*> *_Nullable) aSafetiesParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aSafeties | List of safe driving information |
guidance:shouldPlayVoiceGuide:replaceSndData
Returns whether to play voice guidance. Voice guidance does not play when this method returns NO. Delivers the content of shouldPlayVoiceGuide(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
TIP
Voice guidance is not stopped when switching to background mode during route guidance.
- (BOOL) guidance: (KNGuidance *_Nonnull) aGuidance
shouldPlayVoiceGuide: (KNGuide_Voice *) aVoiceGuide
replaceSndData: (NSData **) aNewDataParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aVoiceGuide | Voice guidance information |
aNewData | List of new voice data to replace the existing voice |
guidance:willPlayVoiceGuide
Plays voice guidance. Delivers the content of willPlayVoiceGuide(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
willPlayVoiceGuide: (KNGuide_Voice *_Nonnull) aVoiceGuideParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aVoiceGuide | Voice guidance information |
guidance:didFinishPlayVoiceGuide
Ends voice guidance. Delivers the content of didFinishPlayVoiceGuide(), called by the guidance state delegate (guideStateDelegate) of KNGuidance, to KNNaviView.
- (void) guidance: (KNGuidance *_Nonnull) aGuidance
didFinishPlayVoiceGuide: (KNGuide_Voice *_Nonnull) aVoiceGuideParameters
| Name | Description |
|---|---|
aGuidance | Route guidance feature and route information |
aVoiceGuide | Voice guidance information |
naviViewDidUpdateUseDarkMode
Sets whether to use night mode.
- (void) naviViewDidUpdateUseDarkMode: (BOOL) aDarkModeParameters
| Name | Description |
|---|---|
aDarkMode | Night mode state |
naviViewDidUpdateMapCameraMode
Sets the camera mode currently used on the map.
- (void) naviViewDidUpdateMapCameraMode: (MapViewCameraMode) aMapViewCameraMode;Parameters
| Name | Description |
|---|---|
aMapViewCameraMode | Current camera mode |
guideNewDestinations:priority:avoidOptions
Cancels safe driving mode and starts new route guidance.
- (void) guideNewDestinations: (KNTrip *_Nonnull) aTrip
priority: (KNRoutePriority) aPriority
avoidOptions: (SInt32) aAvoidOptions;Parameters
| Name | Description |
|---|---|
aTrip | Route to guide |
aPriority | Route search priority option |
aAvoidOptions | Route search restriction option |
guideCancel;
Ends route guidance and switches to safe driving mode.
- (void) guideCancel;setJcImage
Sets whether to display intersection images.
- (void) setJcImage: (BOOL) aJcImagesetMapDriveScale
Sets the map display scale while driving. Depending on the setting, the map uses the default, zoomed-out, or zoomed-in scale.
- (void) setMapDriveScale: (KNMapDriveScale) aMapDriveScale