Constructor 링크 복사
KNMapImage
클래스는 KNSDK
를 통해 생성되어야 합니다.
초깃값으로 설정된 KNMapImage
객체를 생성합니다. 입력한 크기 값은 generateMapWithCompletion
함수를 통해 이미지를 생성할 때 이미지의 크기를 결정합니다.
activity
인자는 지도의 이미지를 생성할 때 필요한 컨텍스트입니다.
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByActivityWithSize(
activity,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByActivityWithSize(
activity,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
초깃값으로 설정된 KNMapImage
객체를 생성합니다. 입력한 크기 값은 generateMapWithCompletion
함수를 통해 이미지를 생성할 때 이미지의 크기를 결정합니다.
view
인자는 지도의 이미지를 생성할 때 필요한 컨텍스트를 추출할 때 사용합니다.
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
함수 링크 복사
지도에 경로를 설정합니다.
fun setRoute( | route: | KNRoute | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun settingRouteWithImageMap(route: KNRoute) {
createMapImage()?.setRoute(route)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun settingRouteWithImageMap(route: KNRoute) {
createMapImage()?.setRoute(route)
}
- route
- 경로
경로 리스트를 전달받아 지도에 경로를 설정합니다.
fun setRoutes( | routes: | List<KNRoute> | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun settingRouteWithImageMap(routes: List<KNRoute>) {
createMapImage()?.setRoutes(routes)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun settingRouteWithImageMap(routes: List<KNRoute>) {
createMapImage()?.setRoutes(routes)
}
- routes
- 경로 리스트
지도에 설정된 모든 경로 리스트를 반환합니다.
fun getRoutes(): | List<KNRoute> |
fun createMapImage(route: List<KNRoute>): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: coordinateLayout 버그(정상적인 값이 아닌 비정상적인 높이, 넓이 값을 주는 경우)로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))?.apply {
setRoutes(route)
}
}
fun getRouteWithImageMap(routes: List<KNRoute>): List<KNRoute> {
return createMapImage(routes)?.getRoutes() ?: emptyList()
}
fun createMapImage(route: List<KNRoute>): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: coordinateLayout 버그(정상적인 값이 아닌 비정상적인 높이, 넓이 값을 주는 경우)로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))?.apply {
setRoutes(route)
}
}
fun getRouteWithImageMap(routes: List<KNRoute>): List<KNRoute> {
return createMapImage(routes)?.getRoutes() ?: emptyList()
}
지도에 등록된 모든 경로를 삭제합니다.
fun removeRoutesAll() |
fun createMapImage(route: List<KNRoute>): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: coordinateLayout 버그(정상적인 값이 아닌 비정상적인 높이, 넓이 값을 주는 경우)로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))?.apply {
setRoutes(route)
}
}
fun removeRouteWithImageMap(routes: List<KNRoute>) {
createMapImage(routes)?.removeRoutesAll()
}
fun createMapImage(route: List<KNRoute>): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: coordinateLayout 버그(정상적인 값이 아닌 비정상적인 높이, 넓이 값을 주는 경우)로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))?.apply {
setRoutes(route)
}
}
fun removeRouteWithImageMap(routes: List<KNRoute>) {
createMapImage(routes)?.removeRoutesAll()
}
입력 받은 사용자 위치 정보를 통해 사용자가 지나간 경로 부분을 자릅니다. 경로의 시작 위치는 KNLocation
을 기준으로 합니다.
fun cullPassedRoute( | guideLocation: | KNLocation | ) |
fun createMapImage(route: List<KNRoute>): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))?.apply {
setRoutes(route)
}
}
fun cullingRouteWithImageMap(routes: List<KNRoute>, cullLocation: KNLocation) {
createMapImage(routes)?.cullPassedRoute(cullLocation)
}
fun createMapImage(route: List<KNRoute>): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))?.apply {
setRoutes(route)
}
}
fun cullingRouteWithImageMap(routes: List<KNRoute>, cullLocation: KNLocation) {
createMapImage(routes)?.cullPassedRoute(cullLocation)
}
- guideLocation
- 위치 정보
지도에 마커를 추가합니다.
fun addMarker( | marker: | KNMapMarker | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addMarkerWithImageMap(marker: KNMapMarker) {
createMapImage()?.addMarker(marker)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addMarkerWithImageMap(marker: KNMapMarker) {
createMapImage()?.addMarker(marker)
}
- marker
- 마커
지도에 마커 리스트를 추가합니다.
fun addMarkers( | markers: | List<KNMapMarker> | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addMarkerWithImageMap(markers: List<KNMapMarker>) {
createMapImage()?.addMarkers(markers)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addMarkerWithImageMap(markers: List<KNMapMarker>) {
createMapImage()?.addMarkers(markers)
}
- markers
- 마커 리스트
지도에서 마커를 제거합니다.
fun removeMarker( | marker: | KNMapMarker | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeMarkerWithImageMap(marker: KNMapMarker) {
createMapImage()?.removeMarker(marker)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeMarkerWithImageMap(marker: KNMapMarker) {
createMapImage()?.removeMarker(marker)
}
- marker
- 마커
지도에 추가된 모든 마커를 제거합니다.
fun removeMarkersAll() |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeMarkersAllWithImageMap() {
createMapImage()?.removeMarkersAll()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeMarkersAllWithImageMap() {
createMapImage()?.removeMarkersAll()
}
지도에 추가된 마커 리스트를 반환합니다. 추가된 마커가 없을 경우 빈 리스트를 반환합니다.
fun getMarkers(): | List<KNMapMarker> |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getMarkersWithImageMap(): List<KNMapMarker> {
return createMapImage()?.getMarkers() ?: emptyList()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getMarkersWithImageMap(): List<KNMapMarker> {
return createMapImage()?.getMarkers() ?: emptyList()
}
지도에 원을 추가합니다.
fun addCircle( | circle: | KNMapCircle | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addCircleWithImageMap(circle: KNMapCircle) {
createMapImage()?.addCircle(circle)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addCircleWithImageMap(circle: KNMapCircle) {
createMapImage()?.addCircle(circle)
}
- circle
- 원
지도에서 원을 제거합니다.
fun removeCircle( | circle: | KNMapCircle | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeCircleWithImageMap(circle: KNMapCircle) {
createMapImage()?.removeCircle(circle)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeCircleWithImageMap(circle: KNMapCircle) {
createMapImage()?.removeCircle(circle)
}
- circle
- 원
지도에 추가된 모든 원을 제거합니다.
fun removeCirclesAll() |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeCirclesAllWithImageMap() {
createMapImage()?.removeCirclesAll()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removeCirclesAllWithImageMap() {
createMapImage()?.removeCirclesAll()
}
지도에 추가된 원 리스트를 반환합니다. 추가된 원이 없을 경우 빈 리스트를 반환합니다.
fun getCircles(): | List<KNMapCircle> |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getCirclesWithImageMap(): List<KNMapCircle> {
return createMapImage()?.getCircles() ?: emptyList()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getCirclesWithImageMap(): List<KNMapCircle> {
return createMapImage()?.getCircles() ?: emptyList()
}
지도에 폴리라인을 추가합니다.
fun addPolyline( | polyline: | KNMapPolyline | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addPolylineWithImageMap(polyline: KNMapPolyline) {
createMapImage()?.addPolyline(polyline)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addPolylineWithImageMap(polyline: KNMapPolyline) {
createMapImage()?.addPolyline(polyline)
}
- polyline
- 폴리라인
지도에서 폴리라인을 제거합니다.
fun removePolyline( | polyline: | KNMapPolyline | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolylineWithImageMap(polyline: KNMapPolyline) {
createMapImage()?.removePolyline(polyline)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolylineWithImageMap(polyline: KNMapPolyline) {
createMapImage()?.removePolyline(polyline)
}
- polyline
- 폴리라인
지도에 추가된 모든 폴리라인을 제거합니다.
fun removePolylinesAll() |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolylinesAllWithImageMap() {
createMapImage()?.removePolylinesAll()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolylinesAllWithImageMap() {
createMapImage()?.removePolylinesAll()
}
지도에 추가된 폴리라인 리스트를 반환합니다. 추가된 폴리라인이 없을 경우 빈 리스트를 반환합니다.
fun getPolylines(): | List<KNMapPolyline> |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getPolylinesWithImageMap(): List<KNMapPolyline> {
return createMapImage()?.getPolylines() ?: emptyList()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getPolylinesWithImageMap(): List<KNMapPolyline> {
return createMapImage()?.getPolylines() ?: emptyList()
}
지도에 폴리곤(다각형)을 추가합니다.
fun addPolygon( | polygon: | KNMapPolygon | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addPolygonWithImageMap(polygon: KNMapPolygon) {
createMapImage()?.addPolygon(polygon)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun addPolygonWithImageMap(polygon: KNMapPolygon) {
createMapImage()?.addPolygon(polygon)
}
- polygon
- 폴리곤
지도에서 폴리곤(다각형)을 제거합니다.
fun removePolygon( | polygon: | KNMapPolygon | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolygonWithImageMap(polygon: KNMapPolygon) {
createMapImage()?.removeMarker(polygon)
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolygonWithImageMap(polygon: KNMapPolygon) {
createMapImage()?.removeMarker(polygon)
}
- polygon
- 폴리곤
지도에 추가된 모든 폴리곤(다각형)을 제거합니다.
fun removePolygonsAll() |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolygonsAllWithImageMap() {
createMapImage()?.removePolygonsAll()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun removePolygonsAllWithImageMap() {
createMapImage()?.removePolygonsAll()
}
지도에 추가된 폴리곤(다각형) 리스트를 반환합니다. 추가된 폴리곤이 없을 경우 빈 리스트를 반환합니다.
fun getPolygons(): | List<KNMapPolygon> |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getPolygonsWithImageMap(): List<KNMapPolygon> {
return createMapImage()?.getPolygons() ?: emptyList()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun getPolygonsWithImageMap(): List<KNMapPolygon> {
return createMapImage()?.getPolygons() ?: emptyList()
}
KNMapCoordinateRegion
을 감싸는 화면의 사각 영역(RectF
)을 반환합니다.
fun getScreenRect( | region: | KNMapCoordinateRegion | ): RectF |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun regionRectWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
// 계산 시 영역이 현재 화면에서 넘어가는 경우 -값을 가질 수 있음.
val screenRectF = getScreenRect(region)
}
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun regionRectWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
// 계산 시 영역이 현재 화면에서 넘어가는 경우 -값을 가질 수 있음.
val screenRectF = getScreenRect(region)
}
}
- region
- 입력 받은 좌표 영역
화면의 사각 영역(RectF
)이 KNMapCoordinateRegion
과 겹치는지 여부를 반환합니다.
fun isOverlappedWithScreenRect( | screenRect: | RectF, | |
region: | KNMapCoordinateRegion | ): Boolean |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun areaCollisionWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val screenPoint = katecToScreen(center)
val screeRectF = RectF(screenPoint.x - 50f, screenPoint.y - 50f, screenPoint.x + 50f, screenPoint.y + 50f)
val collision = isOverlappedWithScreenRect(screeRectF, region)
}
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun areaCollisionWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val screenPoint = katecToScreen(center)
val screeRectF = RectF(screenPoint.x - 50f, screenPoint.y - 50f, screenPoint.x + 50f, screenPoint.y + 50f)
val collision = isOverlappedWithScreenRect(screeRectF, region)
}
}
- screenRect
- 화면의 사각 영역(RectF)
- region
- 입력 받은 좌표 영역
화면의 좌표(FloatPoint
)가 KNMapCoordinateRegion
과 겹치는지 여부를 반환합니다.
fun isOverlappedWithScreenPoint( | screenPoint: | FloatPoint, | |
region: | KNMapCoordinateRegion | ): Boolean |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun pointCollisionWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val screenPoint = katecToScreen(center)
val collision = isOverlappedWithScreenPoint(screenPoint, region)
}
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun pointCollisionWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
val center = WGS84ToKATEC(127.11019081347423,37.3941851228957)
val screenPoint = katecToScreen(center)
val collision = isOverlappedWithScreenPoint(screenPoint, region)
}
}
- screenPoint
- 화면의 좌표(FloatPoint)
- region
- 입력 받은 좌표 영역
KNMapCameraUpdate
의 설정값으로 지도의 카메라 위치를 업데이트합니다.
fun moveCamera( | cameraUpdate: | KNMapCameraUpdate | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun moveCameraWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
val update = KNMapCameraUpdate.
tiltTo(0f).
bearingTo(0f).
fitTo(region)
// targetTo를 추가한 경우 줌 레벨을 맞춘 이후 해당 위치로 이동되고 다시 이동된 위치에서
// 모든 오브젝트가 노출될 수 있도록 줌 레벨을 재조정하게 됩니다.
moveCamera(update)
}
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun moveCameraWithImageMap() {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
val update = KNMapCameraUpdate.
tiltTo(0f).
bearingTo(0f).
fitTo(region)
// targetTo를 추가한 경우 줌 레벨을 맞춘 이후 해당 위치로 이동되고 다시 이동된 위치에서
// 모든 오브젝트가 노출될 수 있도록 줌 레벨을 재조정하게 됩니다.
moveCamera(update)
}
}
- cameraUpdate
- KNMapCameraUpdate의 설정값
지도를 생성합니다. 생성이 완료된 이미지는 KNMiniMapimageLoadListener
로 반환되며 생성에 실패할 경우 loadFailed
가 호출됩니다.
fun generateMapWithCompletion( | completion: | KNMiniMapImageLoadListener | ) |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun regioRectWithImageMapGenerate(listener: KNMiniMapImageLoadListener) {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
// 계산 시 영역이 현재 화면을 넘어가는 경우 -값을 가질 수 있음.
val screenRectF = getScreenRect(region)
generateMapWithCompletion(listener)
}
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun regioRectWithImageMapGenerate(listener: KNMiniMapImageLoadListener) {
createMapImage()?.apply {
val region = KNMapCoordinateRegion.initWithRoute(getRoutes())
region.mergeWithMarkers(getMarkers())
// 계산 시 영역이 현재 화면을 넘어가는 경우 -값을 가질 수 있음.
val screenRectF = getScreenRect(region)
generateMapWithCompletion(listener)
}
}
현재 지도 기준 카텍(KATEC) 좌표를 화면 좌표로 변환합니다.
fun katecToScreen( | katec: | FloatPoint | ): FloatPoint |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun katecToScreenWithImageMap(katec: FloatPoint): FloatPoint {
return createMapImage()?.katecToScreen(katec) ?: FloatPoint()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun katecToScreenWithImageMap(katec: FloatPoint): FloatPoint {
return createMapImage()?.katecToScreen(katec) ?: FloatPoint()
}
- katec
- 카텍 좌표
현재 지도 기준 화면 좌표를 카텍(KATEC)좌표로 변환합니다.
fun screenToKatec( | screen: | FloatPoint | ): FloatPoint |
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun screenToKatecWithImageMap(screen: FloatPoint): FloatPoint {
return createMapImage()?.screenToKatec(screen) ?: FloatPoint()
}
fun createMapImage(): KNMapImage? {
return KNSDK.mapImageByViewWithSize(
// contentView
view,
KNMapTheme.driveNight(),
RectF(0f, 0f, 500f, 500f),
// minRect: 비정상적인 높이/넓이 값을 반환하는 coordinateLayout 버그로 인해 정상적인 사이즈를 측정하지 못할 경우 사용되는 값
RectF(0f, 0f, 500f, 500f))
}
fun screenToKatecWithImageMap(screen: FloatPoint): FloatPoint {
return createMapImage()?.screenToKatec(screen) ?: FloatPoint()
}
- screen
- 화면 좌표