KNNaviView
INFO
This English reference is based on Directions SDK 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 | Image of the vehicle displayed on the map | @property (nonatomic, readonly) KNNaviMapView* _Nonnull mapView; |
curDirView | Background color of the first route guidance information | @property (nonatomic, readonly) KNCurDirectionView* _Nonnull curDirView; |
nextDirView | Background color of the second route guidance information | @property (nonatomic, readonly) KNNextDirectionView* _Nonnull nextDirView |
stateDelegate | Delegate that reports the state of KNNaviView | @property (nonatomic, weak) id<KNNaviView_StateDelegate>_Nullable stateDelegate |
guideStateDelegate | Delegate that reports the guide state of KNNaviView | @property (nonatomic, weak) id<KNNaviView_GuideStateDelegate>_Nullable guideStateDelegate |
Methods
initWithGuidance:trip:routeOption:avoidOption
Creates a 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
Set the night mode.
- (void) useDarkMode: (BOOL) aModesndVolume
Sets the sound volume.
- (void) sndVolume: (float) aVolumeParameters
| Name | Description |
|---|---|
aVolume | Volume setting (range: 0 to 1.0f) |
fuelType
Sets the fuel used by the vehicle.
- (void) fuelType: (KNCarFuel) aFuelTypecarType
Change the vehicle type.
- (void) carType: (KNCarType) aCarTypereleaseView
Creates a naviView.
- (void) releaseViewguidanceGuideStarted
Starts route guidance. The guiding state of KNGuidance is called by the delineated guideStateDelegate) to guidanceGuideStated() of KNNaviView to
- (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. KNGuidanceThe guiding state of the deluge(guideStateDelegate)Called by guidanceGuideEnded() of KNNaviView to 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 completion pop-up 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 voice guidance should play. Return NO to suppress voice guidance. The guiding state of KNGuidance is called by the delineated guideStateDelegate) to shouldPlayVoiceGuide() of KNNaviView to
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 |
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
Set whether to display the image at the intersection.
- (void) setJcImage: (BOOL) aJcImagesetMapDriveScale
Set the display scale of the map during the run. Depending on the setting, the map screen will be displayed as default, shortened, and enlarged.
- (void) setMapDriveScale: (KNMapDriveScale) aMapDriveScale