Constructor 링크 복사
카텍(KATEC) 좌표들로 이뤄진 KNMapPolyline
객체를 생성합니다.
KNMapPolyline(points: List<FloatPoint>, lineColor: Int, lineWidth: Float, lineDashType: KNLineDashType, priority: Int)
KNMapPolyline(points: List<FloatPoint>, lineColor: Int, lineWidth: Float, lineDashType: KNLineDashType, priority: Int)
코드가 숨겨졌습니다.
마커의 우선 순위는 다른 오브젝트(원, 폴리곤 등)보다 항상 높습니다. 따라서, 마커와 같은 값을 가져 위치가 겹치더라도 마커를 최상위 레이어에 표시합니다.
표 1
Properties
Name | Description | Type |
---|---|---|
lineColor | 폴리라인의 색상 (기본값: Color.BLACK ) | var lineColor: Int |
lineWidth | 폴리라인의 두께 (기본값: 2, 두께 설정 범위: 1~5) | var lineWidth: Float |
lineDashType | 폴리라인의 종류. 실선, 점선, 파선, 1점 쇄선, 2점 쇄선 등을 설정할 수 있음. (기본값: KNLineDashType_Solid ) | var lineDashType: KNLineDashType |
priority | 폴리라인을 표시할 우선 순위. 숫자가 높을수록 상위로 표시됨. (기본값: 0, 우선 순위 설정 범위: 0~65535) | var priority: Int |
isVisible | 폴리라인의 표시 여부 (기본값: true ) | var isVisible: Boolean |
tag | 폴리라인에 설정할 태그(tag ). 태그는 Int 값을 가지며 카테고리 분류나 별도의 구분을 하고 싶을 때 사용할 수 있음(선택 사항) | var tag: Int |
id (readOnly) | 폴리라인의 고유 아이디 값 | var id: Int |
예시 코드
KNMapPolyline
fun createPolyLineWithMapView(): KNMapPolyline {
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val pos = (KNSDK.sharedGpsManager()?.lastValidGpsData?.pos) ?: FloatPoint(321397.72f, 532790.94f)
val polygonVertex = arrayListOf<FloatPoint>()
polygonVertex.add(FloatPoint(pos.x - 100f, pos.y - 100f))
polygonVertex.add(FloatPoint(pos.x + 100f, pos.y - 100f))
polygonVertex.add(FloatPoint(pos.x + 100f, pos.y + 100f))
polygonVertex.add(FloatPoint(pos.x - 50f, pos.y + 150f))
return KNMapPolyline(polygonVertex,
lineColor = Color.YELLOW,
lineWidth = 3f,
lineDashType = KNLineDashType.KNLineDashType_Dotted,
priority = 1)
}
fun createPolyLineWithMapView(): KNMapPolyline {
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val pos = (KNSDK.sharedGpsManager()?.lastValidGpsData?.pos) ?: FloatPoint(321397.72f, 532790.94f)
val polygonVertex = arrayListOf<FloatPoint>()
polygonVertex.add(FloatPoint(pos.x - 100f, pos.y - 100f))
polygonVertex.add(FloatPoint(pos.x + 100f, pos.y - 100f))
polygonVertex.add(FloatPoint(pos.x + 100f, pos.y + 100f))
polygonVertex.add(FloatPoint(pos.x - 50f, pos.y + 150f))
return KNMapPolyline(polygonVertex,
lineColor = Color.YELLOW,
lineWidth = 3f,
lineDashType = KNLineDashType.KNLineDashType_Dotted,
priority = 1)
}
코드가 숨겨졌습니다.
함수 링크 복사
카텍(KATEC) 좌표의 정점을 추가합니다. 현재 선의 마지막 정점과 추가된 정점을 연결합니다.
fun addPoint( | point: | FloatPoint | ) |
예시 코드
addPoint
fun createPolyLineToAddPointWithMapView(): KNMapPolyline {
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val pos = (KNSDK.sharedGpsManager()?.lastValidGpsData?.pos) ?: FloatPoint(321397.72f, 532790.94f)
val polylines = arrayListOf<FloatPoint>()
polylines.add(FloatPoint(pos.x - 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y + 100f))
polylines.add(FloatPoint(pos.x - 50f, pos.y + 150f))
return KNMapPolyline(polylines, lineColor = Color.YELLOW,
ineWidth = 3f,
lineDashType = KNLineDashType.KNLineDashType_Dotted,
priority = 1).apply {
val addPointInfo = FloatPoint(pos.x - 50f, pos.y + 50f)
addPoint(addPointInfo)
}
}
fun createPolyLineToAddPointWithMapView(): KNMapPolyline {
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val pos = (KNSDK.sharedGpsManager()?.lastValidGpsData?.pos) ?: FloatPoint(321397.72f, 532790.94f)
val polylines = arrayListOf<FloatPoint>()
polylines.add(FloatPoint(pos.x - 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y + 100f))
polylines.add(FloatPoint(pos.x - 50f, pos.y + 150f))
return KNMapPolyline(polylines, lineColor = Color.YELLOW,
ineWidth = 3f,
lineDashType = KNLineDashType.KNLineDashType_Dotted,
priority = 1).apply {
val addPointInfo = FloatPoint(pos.x - 50f, pos.y + 50f)
addPoint(addPointInfo)
}
}
코드가 숨겨졌습니다.
- point
- 선의 정점
여러 개의 카텍(KATEC) 좌표의 정점을 추가합니다. 현재 선의 마지막 정점과 추가된 정점들을 연결합니다.
fun addPoints( | points: | List<FloatPoint> | ) |
예시 코드
addPoints
fun createPolyLineToAddPointsWithMapView(): KNMapPolyline {
val pos = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val polylines = arrayListOf<FloatPoint>()
polylines.add(FloatPoint(pos.x - 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y + 100f))
polylines.add(FloatPoint(pos.x - 50f, pos.y + 150f))
return KNMapPolyline(polylines,
lineColor = Color.YELLOW,
lineWidth = 3f,
lineDashType = KNLineDashType.KNLineDashType_Dotted,
priority = 1).apply {
val addPointInfo = arrayListOf<FloatPoint>()
addPointInfo.add(FloatPoint(pos.x - 50f, pos.y - 50f))
addPointInfo.add(FloatPoint(pos.x + 50f, pos.y - 50f))
addPointInfo.add(FloatPoint(pos.x + 50f, pos.y + 50f))
addPointInfo.add(FloatPoint(pos.x - 50f, pos.y + 50f))
addPoints(addPointInfo)
}
}
fun createPolyLineToAddPointsWithMapView(): KNMapPolyline {
val pos = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val polylines = arrayListOf<FloatPoint>()
polylines.add(FloatPoint(pos.x - 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y - 100f))
polylines.add(FloatPoint(pos.x + 100f, pos.y + 100f))
polylines.add(FloatPoint(pos.x - 50f, pos.y + 150f))
return KNMapPolyline(polylines,
lineColor = Color.YELLOW,
lineWidth = 3f,
lineDashType = KNLineDashType.KNLineDashType_Dotted,
priority = 1).apply {
val addPointInfo = arrayListOf<FloatPoint>()
addPointInfo.add(FloatPoint(pos.x - 50f, pos.y - 50f))
addPointInfo.add(FloatPoint(pos.x + 50f, pos.y - 50f))
addPointInfo.add(FloatPoint(pos.x + 50f, pos.y + 50f))
addPointInfo.add(FloatPoint(pos.x - 50f, pos.y + 50f))
addPoints(addPointInfo)
}
}
코드가 숨겨졌습니다.
- points
- 선의 정점 리스트