ParseGeoPoint

public struct ParseGeoPoint : Codable, Hashable
extension ParseGeoPoint: CustomDebugStringConvertible

ParseGeoPoint is used to embed a latitude / longitude point as the value for a key in a ParseObject. It could be used to perform queries in a geospatial manner using ParseQuery.-whereKey:nearGeoPoint:. Currently, instances of ParseObject may only have one key associated with a ParseGeoPoint type.

  • Latitude of point in degrees. Valid range is from -90.0 to 90.0.

    Declaration

    Swift

    public var latitude: Double { get set }
  • Longitude of point in degrees. Valid range is from -180.0 to 180.0.

    Declaration

    Swift

    public var longitude: Double { get set }
  • Create a ParseGeoPoint instance. Latitude and longitude are set to 0.0.

    Declaration

    Swift

    public init()
  • Create a new ParseGeoPoint instance with the specified latitude and longitude.

    Declaration

    Swift

    public init(latitude: Double, longitude: Double)

    Parameters

    latitude

    Latitude of point in degrees.

    longitude

    Longitude of point in degrees.

  • Creates a new ParseGeoPoint instance for the given CLLocation, set to the location’s coordinates.

    Declaration

    Swift

    public init(location: CLLocation)

    Parameters

    location

    Instance of CLLocation, with set latitude and longitude.

  • Get distance in radians from this point to specified point.

    Declaration

    Swift

    public func distanceInRadians(_ point: ParseGeoPoint) -> Double

    Parameters

    point

    ParseGeoPoint that represents the location of other point.

    Return Value

    Distance in radians between the receiver and point.

  • Get distance in miles from this point to specified point.

    Declaration

    Swift

    public func distanceInMiles(_ point: ParseGeoPoint) -> Double

    Parameters

    point

    ParseGeoPoint that represents the location of other point.

    Return Value

    Distance in miles between the receiver and point.

  • Get distance in kilometers from this point to specified point.

    Declaration

    Swift

    public func distanceInKilometers(_ point: ParseGeoPoint) -> Double

    Parameters

    point

    ParseGeoPoint that represents the location of other point.

    Return Value

    Distance in kilometers between the receiver and point.

  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    public var debugDescription: String { get }