페이지 이동경로
  • Docs>
  • Kakao Navi>
  • Flutter

Kakao Navi

Flutter

This document describes how to integrate the Kakao Navi API into your service with the Kakao SDK for Flutter (hereinafter referred to as 'Flutter SDK').

Before you begin

Before using Kakao Navi APIs with the Flutter SDK,

  1. Complete the prerequisites.
  2. Register Allowlist to allow the Kakao Navi application to be launched on iOS platform.
  3. After adding kakao_flutter_sdk_navi in pubspec.yaml by referring to Install SDK, add the following libraries in your dart file.
    import 'package:kakao_flutter_sdk_navi/kakao_flutter_sdk_navi.dart';
    

Navigation

To start navigation from a user's current location to the entered destination on the Kakao Navi app, call the navigate() method in the NaviApi class. You must pass destination containing the destination information as an argument. You can also specify the desired search criteria using NaviOption. To add waypoints, pass viaList through Location object.

To check if the Kakao Navi app is installed on a user's device, call the isKakaoNaviInstalled() method. If the Kakao Navi app is installed on a user's device, the app is launched. If not, the user should be directed to the download page for the Kakao Navi app via the default web browser.

Parameter

Name Type Description Required
destination Location Destination information. O
option NaviOption Search criteria to get directions to the destination. X
viaList Location Waypoint information.
Up to three waypoints are allowed.
X
Location
Name Type Description Required
name String Location name.
(Example: "My Home", "Company")
O
x String Longitude coordinate. O
y String Latitude coordinate. O
rpFlag String Destination link.
Currently not supported.
X
NaviOption

Even though you use startX, startY, and startAngle in the NaviOption class, the information of the starting point is only used for a reference, and the current information is set to a starting point when getting directions. You cannot specify a starting point for navigation.

Name Type Description Required
coordType CoordType Coordinate system to use. X
vehicleType VehicleType Vehicle type. X
rpOption RpOption Criteria to optimize routes. X
routeInfo Bool Whether to view entire route information to the destination.
startX String Longitude coordinate of the starting point.

NOTE: This value is only used for a reference to get directions.
For navigation, the current position is used as a starting point regardless of the designated starting point.
X
startY String Latitude coordinate of the starting point.

NOTE: This value is only used for a reference to get directions.
For navigation, the current position is used as a starting point regardless of the designated starting point.
X
startAngle Int Angle of the vehicle at starting point.
A value between 0 and 359.

NOTE: This value is only used for a reference to get directions.
For navigation, the current position is used as a starting point regardless of the designated starting point.
X
returnUri String URI to be redirected when stopping navigation (viewing entire routes). X
Enum: CoordType
Name Description
wgs84 World Geodetic System 84 coordinate system.
katec Katec coordinate system.
This is set as a default.
Enum: VehicleType
Name Description
first Class 1: Passenger car, small van, small truck.
second Class 2: Mid-size van, mid-size truck.
third Class 3: Large van, 2-axis large truck.
fourth Class 4: 3-axis large truck.
fifth Class 5: Special truck with four axes or more.
sixth Class 6: Compact car.
twoWheel Class 7: Motorcycle.
Enum: RpOption
Name Description
fast Fastest route.
free Toll-free route.
shortest Shortest route.
noAuto Route excluding motorway.
wide Main road first.
highway Highway first.
normal Normal road first.
recommended Recommended route.
This is set as a default.

Sample: Navigation

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is installed, navigation starts on Kakao Navi with KATEC.
  await NaviApi.instance.navigate(
    destination: Location(name: '카카오 판교오피스', x: '321286', y: '533707'),
    viaList: [
      Location(name: '판교역 1번출구', x: '321525', y: '532951'),
    ],
  );
} else {
  // If Kakao Navi is not installed, open the download page for Kakao Navi. 
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}

Sample: Navigation via waypoints

This API also provides a function to specify a list of waypoints. Include each local information about the waypoints in the Location object, and pass the list of Location as viaList when calling navigate().

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is installed, navigation to the specified destination via waypoints starts on Kakao Navi on the KATEC coordinate system.
  await NaviApi.instance.navigate(
    destination: Location(name: '카카오 판교오피스', x: '321286', y: '533707'),
    viaList: [ 
      Location(name: '판교역 1번출구', x: '321525', y: '532951'),
    ],
  );
} else {
  // If Kakao Navi is not installed, open the download page for Kakao Navi.
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}

Share location

To share the specified location through the Kakao Navi app, call the shareDestination() method in the NaviApi class. You must pass destination containing the location information as an argument. You can also specify the desired search criteria using NaviOption. To share loacation with waypoints, pass viaList through Location object.

To check if the Kakao Navi app is installed on a user's device, call the isKakaoNaviInstalled() method. If the Kakao Navi app is installed on a user's device, the app is launched. If not, the user should be directed to the download page for the Kakao Navi app via the default web browser.

Parameter

The parameters are the same as the parameters for navigate().

Sample: Sharing location

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is installed, location is shared on Kakao Navi on the KATEC coordinate system.
  await NaviApi.instance.shareDestination(
    destination: Location(name: '카카오 판교오피스', x: '321286', y: '533707'),
  );
} else {
  // If Kakao Navi is not installed, open the download page for Kakao Navi.
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}

Sample: Sharing location via waypoints with WGS84

if (await NaviApi.instance.isKakaoNaviInstalled()) {
  // If Kakao Navi is installed, location including waypoints is shared on Kakao Navi on the WGS84 coordinate system.
  await NaviApi.instance.shareDestination(
    destination: Location(name: '카카오 판교오피스', x: '127.108640', y: '37.402111'),
    option: NaviOption(coordType: CoordType.wgs84),
    viaList: [ 
      Location(name: '판교역 1번출구', x: '321525', y: '532951'),
    ],
  );
} else {
  // If Kakao Navi is not installed, open the download page for Kakao Navi.
  launchBrowserTab(Uri.parse(NaviApi.webNaviInstall));
}

See more