NMGLatLng
@interface NMGLatLng : NSObject <NMGPointable>
위경도 좌표를 나타내는 클래스.
CLLocationCoordinate2D과 달리 위도와 경도를 double형으로 표현합니다.
-
위도. 도 단위.
Declaration
Objective-C
@property (nonatomic) double lat;Swift
var lat: Double { get set } -
경도. 도 단위.
Declaration
Objective-C
@property (nonatomic) double lng;Swift
var lng: Double { get set } -
위경도 좌표로 나타낼 수 있는 커버리지 영역. 전 세계
Declaration
Objective-C
+ (nonnull NMGLatLngBounds *)coverage;Swift
class func coverage() -> NMGLatLngBoundsReturn Value
NMGLatLngBounds객체. -
유효하지 않은(
isValid가NO인) 좌표를 나타내는 상수.Declaration
Objective-C
+ (nonnull NMGLatLng *)invalid;Swift
class func invalid() -> NMGLatLng -
위도와 경도가
DBL_MAX인 객체를 생성합니다.Declaration
Objective-C
+ (nonnull instancetype)latLng;Return Value
NMGLatLng 객체.
-
위도와 경도로 객체를 생성합니다.
Declaration
Objective-C
+ (nonnull instancetype)latLngWithLat:(double)lat lng:(double)lng;Swift
convenience init(lat: Double, lng: Double)Parameters
lat위도.
lng경도.
Return Value
NMGLatLng 객체.
-
CLLocationCoordinate2D로부터 객체를 생성합니다.Declaration
Objective-C
+ (nonnull instancetype)latLngFromCoordinate:(CLLocationCoordinate2D)coordinate;Swift
convenience init(from coordinate: CLLocationCoordinate2D)Parameters
coordinateCLLocationCoordinate2D 객체.
Return Value
NMGLatLng 객체.
-
Declaration
Objective-C
- (nonnull NMGLatLng *)toLatLng;Swift
func toLatLng() -> NMGLatLngReturn Value
self.
-
좌표가 좌표계의 커버리지 내에 포함되는지 여부를 반환합니다. 커버리지를 벗어날 경우 좌표 연산의 정확도가 보장되지 않습니다.
Declaration
Objective-C
- (BOOL)isWithinCoverage;Swift
func isWithinCoverage() -> BoolReturn Value
커버리지 내일 경우
YES, 그렇지 않을 경우NO. -
이 좌표의
lng를 [NMG_LAT_LNG_MINIMUM_LONGITUDE,NMG_LAT_LNG_MAXIMUM_LONGITUDE] 범위로 래핑한 좌표를 반환합니다.lng이미 해당 범위에 속해 있을 경우 새로운 객체가 만들어지지 않고 이 객체가 반환됩니다.Declaration
Objective-C
- (nonnull NMGLatLng *)wrap;Swift
func wrap() -> NMGLatLngReturn Value
경도가 래핑된 좌표 객체.
-
다른 좌표와의 거리를 반환합니다.
Declaration
Objective-C
- (double)distanceTo:(nonnull NMGLatLng *)other;Swift
func distance(to other: NMGLatLng) -> DoubleParameters
other거리를 잴 다른 좌표.
Return Value
좌표 간의 거리. 미터 단위.
-
이 좌표로부터 북쪽으로
northMeter미터, 동쪽으로eastMeter미터만큼 떨어진 좌표를 반환합니다.Declaration
Objective-C
- (nonnull NMGLatLng *)offset:(double)northMeter withEastMeter:(double)eastMeter;Swift
func offset(_ northMeter: Double, withEastMeter eastMeter: Double) -> NMGLatLngParameters
northMeter북쪽 방향 거리. 미터 단위.
eastMeter동쪽 방향 거리. 미터 단위.
Return Value
좌표.
Install in Dash
NMGLatLng Class Reference