NMFCameraUpdate
@interface NMFCameraUpdate : NSObject
지도를 바라보는 카메라의 이동을 정의하는 클래스. 이 클래스의 인스턴스는 직접 생성할 수 없고, 팩토리 메서드를 이용해서
생성할 수 있습니다. 생성한 인스턴스를 파라미터로 삼아 NMFMapView의 -moveCamera:를 호출하면 지도를
이동할 수 있습니다.
카메라의 이동은 다음과 같은 네 가지 요소로 구성됩니다.
- 카메라의 위치: 카메라를 이동할 위치.
CameraUpdate를 생성하는 팩토리 메서드의 파라미터로 지정합니다. - 피봇 지점: 카메라 이동의 기준점이 되는 지점. 피봇 지점을 지정하면 이동, 줌 레벨 변경, 회전의 기준점이 해당 지점이 됩니다.
pivot으로 지정합니다. - 애니메이션: 카메라 이동 시 적용될 애니메이션. 애니메이션의 유형과 시간을 지정할 수 있습니다.
animation과animationDuration으로 지정합니다. - 이동 원인: 카메라 이동의 원인. 이 값을 지정하면
NMFMapViewCameraDelegate의 메서드에reason파라미터로 전달됩니다.reason으로 지정합니다.
-
피봇 지점.
0, 0일 경우 왼쪽 위,1, 1일 경우 오른쪽 아래 지점을 의미합니다.-cameraUpdateWithFitBounds:를 이용해 객체를 생성한 경우에는 무시됩니다.Declaration
Objective-C
@property (nonatomic) CGPoint pivot;Swift
var pivot: CGPoint { get set } -
카메라 이동 시 적용할 애니메이션. 애니메이션의 시간은
DEFAULT_ANIMATION_DURATION으로 지정됩니다.animation이NMFCameraUpdateAnimationNone일 경우 지도가 애니메이션 없이 즉시 이동됩니다.Declaration
Objective-C
@property (nonatomic) NMFCameraUpdateAnimation animation;Swift
var animation: NMFCameraUpdateAnimation { get set } -
카메라 이동 시 적용할 애니메이션의 시간.
기본값은
NMFMapView.animationDuration입니다.Declaration
Objective-C
@property (nonatomic) NSTimeInterval animationDuration;Swift
var animationDuration: TimeInterval { get set } -
카메라 이동의 원인.
기본값은
NMFMapChangedByDeveloper입니다.Declaration
Objective-C
@property (nonatomic) int reason;Swift
var reason: Int32 { get set } -
params를 이용해 카메라를 이동하는NMFCameraUpdate객체를 생성합니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithParams: (nonnull NMFCameraUpdateParams *)params;Swift
convenience init(params: NMFCameraUpdateParams)Parameters
params카메라 이동에 사용할 파라미터.
Return Value
NMFCameraUpdate객체. -
카메라를
position위치로 이동하는NMFCameraUpdate객체를 생성합니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithPosition: (nonnull NMFCameraPosition *)position;Swift
convenience init(position: NMFCameraPosition)Parameters
position새로운 카메라 위치.
Return Value
NMFCameraUpdate객체. -
카메라의 좌표를
target으로 변경하는NMFCameraUpdate객체를 생성합니다. 줌 레벨, 기울기 각도, 헤딩 각도 등 좌표 외의 다른 속성은 변하지 않습니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithScrollTo:(nonnull NMGLatLng *)target;Swift
convenience init(scrollTo target: NMGLatLng)Parameters
target새로운 카메라 좌표.
Return Value
NMFCameraUpdate객체. -
카메라의 좌표를
target으로, 줌 레벨을zoom으로 변경하는NMFCameraUpdate객체를 생성합니다. 기울기 각도, 헤딩 각도 등 좌표와 줌 레벨 외의 다른 속성은 변하지 않습니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithScrollTo:(nonnull NMGLatLng *)target zoomTo:(double)zoom;Swift
convenience init(scrollTo target: NMGLatLng, zoomTo zoom: Double)Parameters
target새로운 카메라 좌표.
zoom새로운 카메라 줌 레벨.
Return Value
NMFCameraUpdate객체. -
카메라를 현재 위치에서
delta포인트만큼 이동하도록 지정하는NMFCameraUpdate객체를 생성합니다. 줌 레벨, 기울기 각도, 헤딩 각도 등 좌표 외의 다른 속성은 변하지 않습니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithScrollBy:(CGPoint)delta;Swift
convenience init(scrollBy delta: CGPoint)Parameters
delta이동할 거리. pt 단위.
Return Value
NMFCameraUpdate객체. -
카메라의 줌 레벨을
1만큼 증가하는NMFCameraUpdate객체를 생성합니다. 좌표, 기울기 각도, 헤딩 각도 등 줌 레벨 외의 다른 속성은 변하지 않습니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithZoomIn;Swift
class func withZoomIn() -> SelfReturn Value
NMFCameraUpdate객체. -
카메라의 줌 레벨을
1만큼 감소하는NMFCameraUpdate객체를 생성합니다. 좌표, 기울기 각도, 헤딩 각도 등 줌 레벨 외의 다른 속성은 변하지 않습니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithZoomOut;Swift
class func withZoomOut() -> SelfReturn Value
NMFCameraUpdate객체. -
카메라의 줌 레벨을
zoom으로 변경하는NMFCameraUpdate객체를 생성합니다. 좌표, 기울기 각도, 헤딩 각도 등 줌 레벨 외의 다른 속성은 변하지 않습니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithZoomTo:(double)zoom;Swift
convenience init(zoomTo zoom: Double)Parameters
zoom새로운 카메라 줌 레벨.
Return Value
NMFCameraUpdate객체. -
카메라의 헤딩 각도를
heading로 변경하는NMFCameraUpdate객체를 생성합니다. 좌표, 기울기 각도, 줌 레벨 등 헤딩 각도 외의 다른 속성은 변하지 않습니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithHeading:(double)heading;Swift
convenience init(heading: Double)Parameters
heading새로운 카메라 헤딩 각도.
Return Value
NMFCameraUpdate객체. -
bounds가 화면에 온전히 보이는 좌표와 최대 줌 레벨로 카메라의 위치를 변경하는NMFCameraUpdate객체를 생성합니다. 기울기 각도와 베어링 각도는0으로 변경되며, 피봇 지점은 무시됩니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithFitBounds: (nonnull NMGLatLngBounds *)bounds;Swift
convenience init(fit bounds: NMGLatLngBounds)Parameters
bounds카메라로 볼 영역.
Return Value
NMFCameraUpdate객체. -
bounds가 화면에 온전히 보이는 좌표와 최대 줌 레벨로 카메라의 위치를 변경하는NMFCameraUpdate객체를 생성합니다. 기울기 각도와 베어링 각도는0으로 변경되며, 피봇 지점은 무시됩니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithFitBounds: (nonnull NMGLatLngBounds *)bounds padding:(CGFloat)padding;Swift
convenience init(fit bounds: NMGLatLngBounds, padding: CGFloat)Parameters
bounds카메라로 볼 영역.
padding카메라가 변경된 후 영역과 지도 화면 간 확보할 최소 여백. pt 단위.
Return Value
NMFCameraUpdate객체. -
bounds가 화면에 온전히 보이는 좌표와 최대 줌 레벨로 카메라의 위치를 변경하는NMFCameraUpdate객체를 생성합니다. 기울기 각도와 베어링 각도는0으로 변경되며, 피봇 지점은 무시됩니다.Declaration
Objective-C
+ (nonnull instancetype)cameraUpdateWithFitBounds: (nonnull NMGLatLngBounds *)bounds paddingInsets:(UIEdgeInsets)paddingInsets;Swift
convenience init(fit bounds: NMGLatLngBounds, paddingInsets: UIEdgeInsets)Parameters
bounds카메라로 볼 영역.
paddingInsets카메라가 변경된 후 영역과 지도 화면 간 확보할 인셋 여백. pt 단위.
Return Value
NMFCameraUpdate객체.
Install in Dash
NMFCameraUpdate Class Reference