FIRGeoPoint.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. /**
  19. * An immutable object representing a geographical point in Firestore. The point is represented as
  20. * a latitude/longitude pair.
  21. *
  22. * Latitude values are in the range of [-90, 90].
  23. * Longitude values are in the range of [-180, 180].
  24. */
  25. NS_SWIFT_SENDABLE
  26. NS_SWIFT_NAME(GeoPoint)
  27. @interface FIRGeoPoint : NSObject <NSCopying>
  28. /** :nodoc: */
  29. - (instancetype)init NS_UNAVAILABLE;
  30. /**
  31. * Creates a `GeoPoint` from the provided latitude and longitude degrees.
  32. * @param latitude The latitude as number between -90 and 90.
  33. * @param longitude The longitude as number between -180 and 180.
  34. */
  35. - (instancetype)initWithLatitude:(double)latitude
  36. longitude:(double)longitude NS_DESIGNATED_INITIALIZER;
  37. /**
  38. * The point's latitude. Must be a value between -90 and 90 (inclusive).
  39. */
  40. @property(nonatomic, readonly) double latitude;
  41. /**
  42. * The point's longitude. Must be a value between -180 and 180 (inclusive).
  43. */
  44. @property(nonatomic, readonly) double longitude;
  45. @end
  46. NS_ASSUME_NONNULL_END