/* * CLLocation.h * CoreLocation * * Copyright (c) 2008-2010 Apple Inc. All rights reserved. * */ #import #import /* * CLLocationDegrees * * Discussion: * Type used to represent a latitude or longitude coordinate in degrees under the WGS 84 reference * frame. The degree can be positive (North and East) or negative (South and West). */ typedef double CLLocationDegrees; /* * CLLocationAccuracy * * Discussion: * Type used to represent a location accuracy level in meters. The lower the value in meters, the * more physically precise the location is. A negative accuracy value indicates an invalid location. */ typedef double CLLocationAccuracy; /* * CLLocationSpeed * * Discussion: * Type used to represent the speed in meters per second. */ typedef double CLLocationSpeed; /* * CLLocationDirection * * Discussion: * Type used to represent the direction in degrees from 0 to 359.9. A negative value indicates an * invalid direction. */ typedef double CLLocationDirection; /* * CLLocationCoordinate2D * * Discussion: * A structure that contains a geographical coordinate. * * Fields: * latitude: * The latitude in degrees. * longitude: * The longitude in degrees. */ typedef struct { CLLocationDegrees latitude; CLLocationDegrees longitude; } CLLocationCoordinate2D; /* * CLLocationDistance * * Discussion: * Type used to represent a distance in meters. */ typedef double CLLocationDistance; /* * kCLDistanceFilterNone * * Discussion: * Use as the distanceFilter property for CLLocationManager. This indicates * to the location service that no minimum movement filter is desired - ie, client will be informed * of any movement. */ extern const CLLocationDistance kCLDistanceFilterNone; /* * kCLLocationAccuracy * * Discussion: * Used to specify the accuracy level desired. The location service will try its best to achieve * your desired accuracy. However, it is not guaranteed. To optimize * power performance, be sure to specify an appropriate accuracy for your usage scenario (eg, * use a large accuracy value when only a coarse location is needed). */ extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); extern const CLLocationAccuracy kCLLocationAccuracyBest; extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters; extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters; extern const CLLocationAccuracy kCLLocationAccuracyKilometer; extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers; /* * kCLLocationCoordinate2DInvalid * * Discussion: * Used to specify an invalid CLLocationCoordinate2D. */ extern const CLLocationCoordinate2D kCLLocationCoordinate2DInvalid __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); #ifdef __cplusplus extern "C" { #endif /* * CLLocationCoordinate2DIsValid * * Discussion: * Returns YES if the specified coordinate is valid, NO otherwise. */ BOOL CLLocationCoordinate2DIsValid(CLLocationCoordinate2D coord) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); /* * CLLocationCoordinate2DMake: * * Discussion: * Returns a new CLLocationCoordinate2D at the given latitude and longitude */ CLLocationCoordinate2D CLLocationCoordinate2DMake(CLLocationDegrees latitude, CLLocationDegrees longitude) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); #ifdef __cplusplus } #endif /* * CLLocation * * Discussion: * Represents a geographical coordinate along with accuracy and timestamp information. */ NS_CLASS_AVAILABLE(10_6, 2_0) @interface CLLocation : NSObject { @private id _internal; } /* * initWithLatitude:longitude: * * Discussion: * Initialize with the specified latitude and longitude. */ - (id)initWithLatitude:(CLLocationDegrees)latitude longitude:(CLLocationDegrees)longitude; /* * initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:timestamp: * * Discussion: * Initialize with the specified parameters. */ - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate altitude:(CLLocationDistance)altitude horizontalAccuracy:(CLLocationAccuracy)hAccuracy verticalAccuracy:(CLLocationAccuracy)vAccuracy timestamp:(NSDate *)timestamp; /* * initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:course:speed:timestamp: * * Discussion: * Initialize with the specified parameters. */ - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate altitude:(CLLocationDistance)altitude horizontalAccuracy:(CLLocationAccuracy)hAccuracy verticalAccuracy:(CLLocationAccuracy)vAccuracy course:(CLLocationDirection)course speed:(CLLocationSpeed)speed timestamp:(NSDate *)timestamp __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_2); /* * coordinate * * Discussion: * Returns the coordinate of the current location. */ @property(readonly, nonatomic) CLLocationCoordinate2D coordinate; /* * altitude * * Discussion: * Returns the altitude of the location. Can be positive (above sea level) or negative (below sea level). */ @property(readonly, nonatomic) CLLocationDistance altitude; /* * horizontalAccuracy * * Discussion: * Returns the horizontal accuracy of the location. Negative if the lateral location is invalid. */ @property(readonly, nonatomic) CLLocationAccuracy horizontalAccuracy; /* * verticalAccuracy * * Discussion: * Returns the vertical accuracy of the location. Negative if the altitude is invalid. */ @property(readonly, nonatomic) CLLocationAccuracy verticalAccuracy; /* * course * * Discussion: * Returns the course of the location in degrees true North. Negative if course is invalid. * * Range: * 0.0 - 359.9 degrees, 0 being true North */ @property(readonly, nonatomic) CLLocationDirection course __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_2_2); /* * speed * * Discussion: * Returns the speed of the location in m/s. Negative if speed is invalid. */ @property(readonly, nonatomic) CLLocationSpeed speed __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_2_2); /* * timestamp * * Discussion: * Returns the timestamp when this location was determined. */ @property(readonly, nonatomic) NSDate *timestamp; /* * description * * Discussion: * Returns a string representation of the location. */ - (NSString *)description; /* * getDistanceFrom: * * Discussion: * Deprecated. Use -distanceFromLocation: instead. */ - (CLLocationDistance)getDistanceFrom:(const CLLocation *)location __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_3_2); /* * distanceFromLocation: * * Discussion: * Returns the lateral distance between two locations. */ - (CLLocationDistance)distanceFromLocation:(const CLLocation *)location __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_2); @end