public class CLLocation extends NSObject implements NSSecureCoding
Constructor and Description |
---|
CLLocation(CLLocationCoordinate2D coordinate,
double altitude,
double horizontalAccuracy,
double verticalAccuracy,
double course,
double speed,
NSDate timestamp)
Constructs a CLLocation object with the specified parameters.
|
CLLocation(CLLocationCoordinate2D coordinate,
double altitude,
double horizontalAccuracy,
double verticalAccuracy,
NSDate timestamp)
Constructs a CLLocation object with the specified parameters.
|
CLLocation(double latitude,
double longitude)
Constructs a CLLocation object with the specified latitude and longitude
parameters.
|
Modifier and Type | Method and Description |
---|---|
double |
altitude()
Returns the altitude of the device expressed in meters.
|
CLLocationCoordinate2D |
coordinate()
Returns the geographical coordinates of the device.
|
double |
course()
Returns device's direction as it moves.
|
double |
distanceFromLocation(CLLocation location)
Returns the distance between this location object and the specified one,
expressed in meters.
|
boolean |
equals(Object obj) |
int |
hashCode() |
double |
horizontalAccuracy()
Returns the radius of location's uncertainty expressed in meters.
|
double |
speed()
Returns the instantaneous speed of the device expressed in meters per
seconds.
|
NSDate |
timestamp()
Returns the timestamp of the location record.
|
String |
toString() |
double |
verticalAccuracy()
Returns the altitude's accuracy expressed in meters.
|
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
supportsSecureCoding
public CLLocation(double latitude, double longitude)
latitude
- The latitude of the CLLocation object.longitude
- The longitude of the CLLocation object.public CLLocation(CLLocationCoordinate2D coordinate, double altitude, double horizontalAccuracy, double verticalAccuracy, NSDate timestamp)
coordinate
- A structure that contains the latitude and longitude.altitude
- The altitude of the location.horizontalAccuracy
- The accuracy of the coordinate.verticalAccuracy
- The accuracy of the altitude.timestamp
- The time to associate with the location object.public CLLocation(CLLocationCoordinate2D coordinate, double altitude, double horizontalAccuracy, double verticalAccuracy, double course, double speed, NSDate timestamp)
coordinate
- A structure that contains the latitude and longitude.altitude
- The altitude of the location.horizontalAccuracy
- The accuracy of the coordinate.verticalAccuracy
- The accuracy of the altitude.course
- The direction of traveling.speed
- The current speed.timestamp
- The time to associate with the location object.public double altitude()
public CLLocationCoordinate2D coordinate()
public double course()
public double horizontalAccuracy()
public double speed()
public NSDate timestamp()
public double verticalAccuracy()
public double distanceFromLocation(CLLocation location)
location
- The location object from which the distance is measured.Copyright © 2020. All rights reserved.