NMFProjection
@interface NMFProjection : NSObject
지리적 좌표와 화면 좌표 간의 변환을 담당하는 클래스. 이 클래스의 인스턴스는 직접 생성할 수 없고
NMFMapView.projection을 이용해서 가져올 수 있습니다.
-
화면 좌표를 카메라가 지정된 줌 레벨, 틸트/베어링 각도일 때의 위경도 좌표로 변환합니다. 일반적인 상황에는
-latlngFromPoint:point:를 사용하세요.Declaration
Objective-C
- (nonnull NMGLatLng *)latlngFromPoint:(CGPoint)point atZoom:(double)zoom atTilt:(double)tilt atHeading:(double)heading withWrap:(BOOL)wrap;Swift
func latlng(from point: CGPoint, atZoom zoom: Double, atTilt tilt: Double, atHeading heading: Double, withWrap wrap: Bool) -> NMGLatLngParameters
point화면 좌표.
zoom줌 레벨.
tilt틸트 각도.
heading헤딩 각도.
wrap좌표를 랩핑할지 여부.
Return Value
위경도 좌표.
point가nil이거나 화면 좌표의 범위가 위경도 좌표로 표현할 수 있는 범위를 벗어난 경우 유효하지 않은(NMGLatLng.isValid()가NO인) 좌표가 반환됩니다. -
위경도 좌표를 카메라가 지정된 줌 레벨, 틸트/베어링 각도일 때의 화면 좌표로 변환합니다. 일반적인 상황에는
-pointFromLatLng:coord:를 사용하세요.Declaration
Objective-C
- (CGPoint)pointFromLatLng:(nonnull NMGLatLng *)coord atZoom:(double)zoom atTilt:(double)tilt atHeading:(double)heading withShortestPath:(BOOL)shortestPath;Swift
func point(from coord: NMGLatLng, atZoom zoom: Double, atTilt tilt: Double, atHeading heading: Double, withShortestPath shortestPath: Bool) -> CGPointParameters
coord위경도 좌표.
zoom줌 레벨.
tilt틸트 각도.
heading헤딩 각도.
shortestPath가까운 좌표를 사용할지 여부.
Return Value
화면 좌표.
coord가nil이거나, 위경도 좌표의 범위가 화면 좌표로 표현할 수 있는 범위를 벗어난 경우 유효하지 않은(CGPoint.x또는CGPoint.y가 무한대인) 좌표가 반환됩니다. -
화면의 영역을 위경도 영역으로 변환합니다.
Declaration
Objective-C
- (nonnull NMGLatLngBounds *)latlngBoundsFromViewBounds:(CGRect)viewBounds;Swift
func latlngBounds(fromViewBounds viewBounds: CGRect) -> NMGLatLngBoundsParameters
viewBounds화면 영역.
Return Value
위경도 영역.
-
위경도 영역을 화면 영역으로 변환합니다.
Declaration
Objective-C
- (CGRect)viewBoundsFromLatLngBounds:(nonnull NMGLatLngBounds *)latlngBounds;Swift
func viewBounds(from latlngBounds: NMGLatLngBounds) -> CGRectParameters
latlngBounds위경도 영역.
Return Value
화면 영역.
-
현재 지도의 축척을 반환합니다.
Declaration
Objective-C
- (CLLocationDistance)metersPerPixel;Swift
func metersPerPixel() -> CLLocationDistanceReturn Value
축척. 미터/픽셀 단위.
-
카메라의 위도가
latitude, 줌 레벨이zoom일 때의 축적을 반환합니다.Declaration
Objective-C
- (CLLocationDistance)metersPerPixelAtLatitude:(double)latitude zoom:(double)zoom;Swift
func metersPerPixel(atLatitude latitude: Double, zoom: Double) -> CLLocationDistanceParameters
latitude위도.
zoom줌 레벨.
Return Value
축척. 미터/픽셀 단위.
Install in Dash
NMFProjection Class Reference