Constructor 링크 복사

초깃값으로 설정된 KNMapCameraUpdate 객체를 생성합니다.

예시 코드 KNMapCameraUpdate()
fun createKNCameraUpdate(): KNMapCameraUpdate {
    return KNMapCameraUpdate()
}

fun moveMap(withUserLocation: Boolean) {
    mapView.moveCamera(createKNCameraUpdate(), withUserLocation)
}
fun createKNCameraUpdate(): KNMapCameraUpdate {
    return KNMapCameraUpdate()
}

fun moveMap(withUserLocation: Boolean) {
    mapView.moveCamera(createKNCameraUpdate(), withUserLocation)
}
코드가 숨겨졌습니다.

입력된 위치로 초기화된 KNMapCameraUpdate 객체를 생성합니다. 카텍(KATEC) 좌표계를 사용하여 위도와 경도를 표시합니다.

KNMapCameraUpdate.targetTo( coordinate: FloatPoint ): KNMapCameraUpdate
예시 코드 KNMapCameraUpdate.targetTo:
fun positionWithKNMapCameraUpdate(coordinate: FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate.targetTo(coordinate)
}

fun moveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    if (isAnimate) {
        mapView.animateCamera(positionWithKNMapCameraUpdate(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(positionWithKNMapCameraUpdate(coordinate), withUserLocation)
    }    
}
fun positionWithKNMapCameraUpdate(coordinate: FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate.targetTo(coordinate)
}

fun moveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    if (isAnimate) {
        mapView.animateCamera(positionWithKNMapCameraUpdate(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(positionWithKNMapCameraUpdate(coordinate), withUserLocation)
    }    
}
코드가 숨겨졌습니다.

coordinate
이동할 위치의 카텍 좌표

입력된 줌 레벨 값으로 초기화된 KNMapCameraUpdate 객체를 생성합니다. 줌 레벨 설정의 범위는 KNMapView 클래스의 setZoomRange에서 설정한 범위를 따릅니다.

KNMapCameraUpdate.zoomTo( zoom: Float ): KNMapCameraUpdate
예시 코드 KNMapCameraUpdate.zoomTo:
fun zoomWithKNMapCameraUpdate(zoom:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate.zoomTo(zoom)
}

fun zoomToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isZoomIn: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val zoom = if (isZoomIn) { mapView.zoom * .5f } else { mapView.zoom * 2f }
    if (isAnimate) {
        mapView.animateCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), withUserLocation)
    }
}
fun zoomWithKNMapCameraUpdate(zoom:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate.zoomTo(zoom)
}

fun zoomToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isZoomIn: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val zoom = if (isZoomIn) { mapView.zoom * .5f } else { mapView.zoom * 2f }
    if (isAnimate) {
        mapView.animateCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

zoom
지도에 적용할 줌 레벨

입력된 기울기 값으로 초기화된 KNMapCameraUpdate 객체를 생성합니다. (기울기 설정 범위: 0~50)

KNMapCameraUpdate.tiltTo( tilt: Float ): KNMapCameraUpdate
예시 코드 KNMapCameraUpdate.tiltTo:
fun tiltWithKNMapCameraUpdate(tilt:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate.tiltTo(tilt)
}

fun tiltWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isBirdView: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val tilt = if (isBirdView) { 50f } else { 0f }
    if (isAnimate) {
        mapView.animateCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), withUserLocation)
    }
}
fun tiltWithKNMapCameraUpdate(tilt:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate.tiltTo(tilt)
}

fun tiltWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isBirdView: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val tilt = if (isBirdView) { 50f } else { 0f }
    if (isAnimate) {
        mapView.animateCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

tilt
지도에 적용할 화면 기울기(기울기 설정 범위: 0~50)

입력된 회전 값으로 초기화된 KNMapCameraUpdate 객체를 생성합니다. (회전 각도 설정 범위: 0~360)

KNMapCameraUpdate.bearingTo( bearing: Float ): KNMapCameraUpdate
예시 코드 KNMapCameraUpdate.bearingTo:
fun bearingWithKNMapCameraUpdate(bearing:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate.bearingTo(bearing)
}

fun bearing45WithMoveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val bearing = mapView.bearing + 45f // 회전 각도를 45도로 설정
    if (isAnimate) {
        mapView.animateCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), withUserLocation)
    }
}
fun bearingWithKNMapCameraUpdate(bearing:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate.bearingTo(bearing)
}

fun bearing45WithMoveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val bearing = mapView.bearing + 45f // 회전 각도를 45도로 설정
    if (isAnimate) {
        mapView.animateCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

bearing
지도에 적용할 회전 각도(회전 각도 설정 범위: 0~360)

입력된 앵커 값으로 초기화된 KNMapCameraUpdate 객체를 생성하며 화면의 줌, 기울기, 회전의 기준점을 설정합니다. 기본값은 정중앙(0.5, 0.5)이며 새롭게 설정한 기준점을 중심으로 줌 레벨, 기울기, 회전 방향을 동작합니다.

화면의 값은 (x축, y축)으로 표시되며 왼쪽 아래의 모서리 값은 (0, 0), 오른쪽 위의 모서리 값은 (1, 1)입니다. 오른쪽으로 이동 시 x축 +0.1, 위쪽으로 이동 시 y축 +0.1을 합니다.

KNMapCameraUpdate.anchorTo( anchor: FloatPoint ): KNMapCameraUpdate
예시 코드 KNMapCameraUpdate.anchorTo:
fun anchorWithKNMapCameraUpdate(anchor:FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate.anchorTo(anchor)
}

fun anchorToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isDownToAnchor: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val anchor = if (isDownToAnchor) { FloatPoint(0.5f, 0.8f) } else { FloatPoint(0.5f, 0.5f) }
    if (isAnimate) {
        mapView.animateCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), withUserLocation)
    }
}
fun anchorWithKNMapCameraUpdate(anchor:FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate.anchorTo(anchor)
}

fun anchorToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isDownToAnchor: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val anchor = if (isDownToAnchor) { FloatPoint(0.5f, 0.8f) } else { FloatPoint(0.5f, 0.5f) }
    if (isAnimate) {
        mapView.animateCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

anchor
기준점(x축, y축), 왼쪽 아래 모서리 값(0, 0), 오른쪽 위 모서리 값(1, 1)

KNMapCoordinateRegion에서 전달받은 좌표 영역을 화면에 맞추거나 화면 안의 특정 사각 영역(RectF)에 맞춥니다. (RectFnull이면 지도 전체 사이즈에 적용)

KNMapCameraUpdate.fitTo( regionMap: KNMapCoordinateRegion,
fittingRect: RectF? = null ): KNMapCameraUpdate

regionMap
화면의 영역을 계산하기 위한 객체(경로, 마커 오브젝트 등)
fittingRect
카메라의 상태가 업데이트 되었을 때 기준이 되는 화면의 영역

함수 링크 복사

지도상 현재 위치를 새로운 위치로 이동합니다. 카텍(KATEC) 좌표계를 사용하여 위도와 경도를 표시합니다.

fun targetTo( position: FloatPoint ): KNMapCameraUpdate
예시 코드 targetTo:
fun positionWithKNMapCameraUpdate(coordinate: FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate.targetTo(coordinate)
}

fun moveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    if (isAnimate) {
        mapView.animateCamera(positionWithKNMapCameraUpdate(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(positionWithKNMapCameraUpdate(coordinate), withUserLocation)
    }
}
fun positionWithKNMapCameraUpdate(coordinate: FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate.targetTo(coordinate)
}

fun moveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    if (isAnimate) {
        mapView.animateCamera(positionWithKNMapCameraUpdate(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(positionWithKNMapCameraUpdate(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

position
이동할 위치의 카텍 좌표

지도상 현재 위치를 중심으로 줌 레벨을 설정합니다. (줌 레벨 설정 범위: 0.1~2000)

fun zoomTo( zoom: Float ): KNMapCameraUpdate
예시 코드 zoomTo:
fun zoomWithKNMapCameraUpdate(zoom:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate().zoomTo(zoom)
}

fun zoomToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isZoomIn: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val zoom = if (isZoomIn) { mapView.zoom * .5f } else { mapView.zoom * 2f }
    if (isAnimate) {
        mapView.animateCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), withUserLocation)
    }
}
fun zoomWithKNMapCameraUpdate(zoom:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate().zoomTo(zoom)
}

fun zoomToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isZoomIn: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val zoom = if (isZoomIn) { mapView.zoom * .5f } else { mapView.zoom * 2f }
    if (isAnimate) {
        mapView.animateCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(zoomWithKNMapCameraUpdate(zoom).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

zoom
지도에 적용할 줌 레벨(줌 레벨 설정 범위: 0.1~2000)

지도상 현재 위치를 중심으로 화면 기울기를 설정합니다. (기울기 설정 범위: 0~50)

fun tiltTo( degree: Float ): KNMapCameraUpdate
예시 코드 tiltTo:
fun tiltWithKNMapCameraUpdate(tilt:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate().tiltTo(tilt)
}

fun tiltWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isBirdView: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val tilt = if (isBirdView) { 50f } else { 0f }
    if (isAnimate) {
        mapView.animateCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), withUserLocation)
    }
}
fun tiltWithKNMapCameraUpdate(tilt:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate().tiltTo(tilt)
}

fun tiltWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isBirdView: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val tilt = if (isBirdView) { 50f } else { 0f }
    if (isAnimate) {
        mapView.animateCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(tiltWithKNMapCameraUpdate(tilt).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

degree
지도에 적용할 화면 기울기(기울기 설정 범위: 0~50)

지도상 현재 위치를 중심으로 회전 각도를 설정합니다. (회전 각도 설정 범위: 0~360)

fun bearingTo( degree: Float ): KNMapCameraUpdate
예시 코드 bearingTo:
fun bearingWithKNMapCameraUpdate(bearing:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate().bearingTo(bearing)
}

fun bearing45WithMoveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val bearing = mapView.bearing + 45f
    if (isAnimate) {
        mapView.animateCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), withUserLocation)
    }
}
fun bearingWithKNMapCameraUpdate(bearing:Float): KNMapCameraUpdate {
    return KNMapCameraUpdate().bearingTo(bearing)
}

fun bearing45WithMoveMap(withUserLocation: Boolean, isAnimate: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val bearing = mapView.bearing + 45f
    if (isAnimate) {
        mapView.animateCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(bearingWithKNMapCameraUpdate(bearing).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

degree
지도에 적용할 회전 각도(회전 각도 설정 범위: 0~360)

화면의 줌, 기울기, 회전의 기준점을 설정합니다. 기본값은 정중앙(0.5, 0.5)이며 새롭게 설정한 기준점을 중심으로 줌 레벨, 기울기, 회전 방향을 동작합니다.

화면의 값은 (x축, y축)으로 표시되며 왼쪽 아래의 모서리 값은 (0, 0), 오른쪽 위의 모서리 값은 (1, 1)입니다. 오른쪽으로 이동 시 x축 +0.1, 위쪽으로 이동 시 y축 +0.1을 합니다.

fun anchorTo( anchor: FloatPoint ): KNMapCameraUpdate
예시 코드 anchorTo:
fun anchorWithKNMapCameraUpdate(anchor:FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate().anchorTo(anchor)
}

fun anchorToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isDownToAnchor: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val anchor = if (isDownToAnchor) { FloatPoint(0.5f, 0.8f) } else { FloatPoint(0.5f, 0.5f)
    }
    if (isAnimate) {
        mapView.animateCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), withUserLocation)
    }
}
fun anchorWithKNMapCameraUpdate(anchor:FloatPoint): KNMapCameraUpdate {
    return KNMapCameraUpdate().anchorTo(anchor)
}

fun anchorToWithMoveMap(withUserLocation: Boolean, isAnimate: Boolean, isDownToAnchor: Boolean) {
    val coordinate = WGS84ToKATEC(127.11019081347423,37.3941851228957)
    val anchor = if (isDownToAnchor) { FloatPoint(0.5f, 0.8f) } else { FloatPoint(0.5f, 0.5f)
    }
    if (isAnimate) {
        mapView.animateCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), 500L, withUserLocation)
    } else {
        mapView.moveCamera(anchorWithKNMapCameraUpdate(anchor).targetTo(coordinate), withUserLocation)
    }
}
코드가 숨겨졌습니다.

anchor
기준점(x축, y축), 왼쪽 아래 모서리 값(0, 0), 오른쪽 위 모서리 값(1, 1)

KNMapCoordinateRegion에서 전달받은 좌표 영역을 화면에 맞추거나 화면 안의 특정 사각 영역(RectF)에 맞춥니다. (RectFnull이면 지도 전체 사이즈에 적용)

fun fitTo( regionMap: KNMapCoordinateRegion,
fittingRect: RectF? = null ): KNMapCameraUpdate

regionMap
화면의 영역을 계산하기 위한 객체(경로, 마커 오브젝트 등)
fittingRect
카메라의 상태가 업데이트 되었을 때 기준이 되는 화면의 영역