KNMapUserLocation
INFO
This English reference is based on Directions SDK 1.12.8-hotfix02. For the latest version, see the Korean reference.
Displays the user's current location. A map supports only one user location.
Properties
| Name | Description | Type |
|---|---|---|
icon | Sets the image used to display the user's location. If no custom image is set, the default image is used. | var icon: Bitmap? |
coordinate | KATEC coordinates where the user's location is displayed | var coordinate: FloatPoint |
pixelOffset | User-location image offset in pixels, expressed as (x-axis, y-axis). The origin is the bottom center of the image. Positive x moves the image right, and positive y moves it down. (default: origin) | var pixelOffset: IntPoint |
isVisible | Whether to display the user's location. When set to false, the guidelines are also hidden.(default: true) | var isVisible: Boolean |
priority | Priority for displaying user location. The higher the number, the higher it appears. (default: 65535, priority range: 0~65535) | var priority: Int |
guideLineColor | Color of the guide line connecting the current user's location and destination in a straight line (default: blue) | var guideLineColor: Int |
guideLineGoal | Sets the destination position for the guide line. Setting the destination directly provides a more accurate guide line. If unset, the route endpoint is used. | var guideLineGoal: FloatPoint |
guideLineWidth | Thickness of the guide line connecting the current user's location and destination in a straight line (Line thickness setting range: 1~5) | var guideLineWidth: Float |
guideLineDashType | The shape of the guide line connecting the current user's location and destination with a straight line (default: KNLineDashType_Dashed) | var guideLineDashType: KNLineDashType |
isVisibleGuideLine | Whether the guide line connecting the user's current location and the destination is displayed. When isVisible is false, the guide line remains hidden and changes to this property are not applied until isVisible becomes true.(default: true) | var isVisibleGuideLine: Boolean |
angle | Sets the direction of the user-location image. (If 0, it points to true north) | var angle: Float |
id (readOnly) | Unique ID of the user location | var id: Int |
isFlat | Sets whether the vehicle icon follows the screen tilt. If true, the icon is affected by tilt.(default: true) | var isFlat: Boolean |
useSingleTapped | Whether single-tap events are enabled. (default: true) | var useSingleTapped: Boolean = true |
useDoubleTapped | Whether double-tap events are enabled. If this value is false, KNMapUserLocationEventListener does not receive double-tap events.(default: true) | var useDoubleTapped: Boolean = true |
useLongPressed | Whether long-press events are enabled. (default: true) | var useLongPressed: Boolean = true |
eventListener | Listener for user-location touch and animation completion events | var eventListener: KNMapUserLocationEventListener? = null |
Methods
animate
Animates the user location to the specified coordinates and angle over the specified duration.
kotlin
fun animte( coordinate: FloatPoint,
angle: Float,
duration: Long )Parameters
| Name | Description |
|---|---|
coordinate | KATEC coordinates of the location to move to |
angle | Rotation Angle |
duration | Animation duration(unit: ms) |