GMSGroundOverlay.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // GMSGroundOverlay.h
  3. // Google Maps SDK for iOS
  4. //
  5. // Copyright 2013 Google Inc.
  6. //
  7. // Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
  8. // Service: https://developers.google.com/maps/terms
  9. //
  10. #import <GoogleMaps/GMSOverlay.h>
  11. #if __has_feature(modules)
  12. @import GoogleMapsBase;
  13. #else
  14. #import <GoogleMapsBase/GoogleMapsBase.h>
  15. #endif
  16. @class GMSCoordinateBounds;
  17. GMS_ASSUME_NONNULL_BEGIN
  18. /**
  19. * GMSGroundOverlay specifies the available options for a ground overlay that
  20. * exists on the Earth's surface. Unlike a marker, the position of a ground
  21. * overlay is specified explicitly and it does not face the camera.
  22. */
  23. @interface GMSGroundOverlay : GMSOverlay
  24. /**
  25. * The position of this GMSGroundOverlay, or more specifically, the physical
  26. * position of its anchor. If this is changed, |bounds| will be moved around
  27. * the new position.
  28. */
  29. @property(nonatomic, assign) CLLocationCoordinate2D position;
  30. /**
  31. * The anchor specifies where this GMSGroundOverlay is anchored to the Earth in
  32. * relation to |bounds|. If this is modified, |position| will be set to the
  33. * corresponding new position within |bounds|.
  34. */
  35. @property(nonatomic, assign) CGPoint anchor;
  36. /**
  37. * Icon to render within |bounds| on the Earth. If this is nil, the overlay will
  38. * not be visible (unlike GMSMarker which has a default image).
  39. */
  40. @property(nonatomic, strong) UIImage *GMS_NULLABLE_PTR icon;
  41. /**
  42. * Sets the opacity of the ground overlay, between 0 (completely transparent)
  43. * and 1 (default) inclusive.
  44. */
  45. @property(nonatomic, assign) float opacity;
  46. /**
  47. * Bearing of this ground overlay, in degrees. The default value, zero, points
  48. * this ground overlay up/down along the normal Y axis of the earth.
  49. */
  50. @property(nonatomic, assign) CLLocationDirection bearing;
  51. /**
  52. * The 2D bounds on the Earth in which |icon| is drawn. Changing this value
  53. * will adjust |position| accordingly.
  54. */
  55. @property(nonatomic, strong) GMSCoordinateBounds *GMS_NULLABLE_PTR bounds;
  56. /**
  57. * Convenience constructor for GMSGroundOverlay for a particular |bounds| and
  58. * |icon|. Will set |position| accordingly.
  59. */
  60. + (instancetype)groundOverlayWithBounds:(GMSCoordinateBounds *GMS_NULLABLE_PTR)bounds
  61. icon:(UIImage *GMS_NULLABLE_PTR)icon;
  62. /**
  63. * Constructs a GMSGroundOverlay that renders the given |icon| at |position|,
  64. * as if the image's actual size matches camera pixels at |zoomLevel|.
  65. */
  66. + (instancetype)groundOverlayWithPosition:(CLLocationCoordinate2D)position
  67. icon:(UIImage *GMS_NULLABLE_PTR)icon
  68. zoomLevel:(CGFloat)zoomLevel;
  69. @end
  70. /**
  71. * The default position of the ground anchor of a GMSGroundOverlay: the center
  72. * point of the icon.
  73. */
  74. FOUNDATION_EXTERN const CGPoint kGMSGroundOverlayDefaultAnchor;
  75. GMS_ASSUME_NONNULL_END