FIRGeoPoint.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_NAME(GeoPoint)
  26. @interface FIRGeoPoint : NSObject <NSCopying>
  27. /** :nodoc: */
  28. - (instancetype)init NS_UNAVAILABLE;
  29. /**
  30. * Creates a `GeoPoint` from the provided latitude and longitude degrees.
  31. * @param latitude The latitude as number between -90 and 90.
  32. * @param longitude The longitude as number between -180 and 180.
  33. */
  34. - (instancetype)initWithLatitude:(double)latitude
  35. longitude:(double)longitude NS_DESIGNATED_INITIALIZER;
  36. /**
  37. * The point's latitude. Must be a value between -90 and 90 (inclusive).
  38. */
  39. @property(nonatomic, readonly) double latitude;
  40. /**
  41. * The point's longitude. Must be a value between -180 and 180 (inclusive).
  42. */
  43. @property(nonatomic, readonly) double longitude;
  44. @end
  45. NS_ASSUME_NONNULL_END