GMSCameraUpdate.h 3.2 KB

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