GMSCameraUpdate.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //
  2. // GMSCameraUpdate.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 <CoreLocation/CoreLocation.h>
  11. #import <UIKit/UIKit.h>
  12. #if __has_feature(modules)
  13. @import GoogleMapsBase;
  14. #else
  15. #import <GoogleMapsBase/GoogleMapsBase.h>
  16. #endif
  17. @class GMSCameraPosition;
  18. @class GMSCoordinateBounds;
  19. GMS_ASSUME_NONNULL_BEGIN
  20. /**
  21. * GMSCameraUpdate represents an update that may be applied to a GMSMapView.
  22. * It encapsulates some logic for modifying the current camera.
  23. * It should only be constructed using the factory helper methods below.
  24. */
  25. @interface GMSCameraUpdate : NSObject
  26. /**
  27. * Returns a GMSCameraUpdate that zooms in on the map.
  28. * The zoom increment is 1.0.
  29. */
  30. + (GMSCameraUpdate *)zoomIn;
  31. /**
  32. * Returns a GMSCameraUpdate that zooms out on the map.
  33. * The zoom increment is -1.0.
  34. */
  35. + (GMSCameraUpdate *)zoomOut;
  36. /**
  37. * Returns a GMSCameraUpdate that changes the zoom by the specified amount.
  38. */
  39. + (GMSCameraUpdate *)zoomBy:(float)delta;
  40. /**
  41. * Returns a GMSCameraUpdate that sets the zoom to the specified amount.
  42. */
  43. + (GMSCameraUpdate *)zoomTo:(float)zoom;
  44. /**
  45. * Returns a GMSCameraUpdate that sets the camera target to the specified
  46. * coordinate.
  47. */
  48. + (GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target;
  49. /**
  50. * Returns a GMSCameraUpdate that sets the camera target and zoom to the
  51. * specified values.
  52. */
  53. + (GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target zoom:(float)zoom;
  54. /**
  55. * Returns a GMSCameraUpdate that sets the camera to the specified
  56. * GMSCameraPosition.
  57. */
  58. + (GMSCameraUpdate *)setCamera:(GMSCameraPosition *)camera;
  59. /**
  60. * Returns a GMSCameraUpdate that transforms the camera such that the specified
  61. * bounds are centered on screen at the greatest possible zoom level. The bounds
  62. * will have a default padding of 64 points.
  63. *
  64. * The returned camera update will set the camera's bearing and tilt to their
  65. * default zero values (i.e., facing north and looking directly at the Earth).
  66. */
  67. + (GMSCameraUpdate *)fitBounds:(GMSCoordinateBounds *)bounds;
  68. /**
  69. * This is similar to fitBounds: but allows specifying the padding (in points)
  70. * in order to inset the bounding box from the view's edges.
  71. * If the requested |padding| is larger than the view size in either the
  72. * vertical or horizontal direction the map will be maximally zoomed out.
  73. */
  74. + (GMSCameraUpdate *)fitBounds:(GMSCoordinateBounds *)bounds
  75. withPadding:(CGFloat)padding;
  76. /**
  77. * This is similar to fitBounds: but allows specifying edge insets
  78. * in order to inset the bounding box from the view's edges.
  79. * If the requested |edgeInsets| are larger than the view size in either the
  80. * vertical or horizontal direction the map will be maximally zoomed out.
  81. */
  82. + (GMSCameraUpdate *)fitBounds:(GMSCoordinateBounds *)bounds
  83. withEdgeInsets:(UIEdgeInsets)edgeInsets;
  84. /**
  85. * Returns a GMSCameraUpdate that shifts the center of the view by the
  86. * specified number of points in the x and y directions.
  87. * X grows to the right, Y grows down.
  88. */
  89. + (GMSCameraUpdate *)scrollByX:(CGFloat)dX Y:(CGFloat)dY;
  90. /**
  91. * Returns a GMSCameraUpdate that zooms with a focus point; the focus point
  92. * stays fixed on screen.
  93. */
  94. + (GMSCameraUpdate *)zoomBy:(float)zoom atPoint:(CGPoint)point;
  95. @end
  96. GMS_ASSUME_NONNULL_END