GMSCameraUpdate.h 3.22 KB
Newer Older
Julio Hermosa committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
//
//  GMSCameraUpdate.h
//  Google Maps SDK for iOS
//
//  Copyright 2013 Google LLC
//
//  Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
//  Service: https://developers.google.com/maps/terms
//

#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>

@class GMSCameraPosition;
@class GMSCoordinateBounds;

NS_ASSUME_NONNULL_BEGIN

/**
 * GMSCameraUpdate represents an update that may be applied to a GMSMapView.
 *
 * It encapsulates some logic for modifying the current camera.
 *
 * It should only be constructed using the factory helper methods below.
 */
@interface GMSCameraUpdate : NSObject

/**
 * Returns a GMSCameraUpdate that zooms in on the map.
 *
 * The zoom increment is 1.0.
 */
+ (GMSCameraUpdate *)zoomIn;

/**
 * Returns a GMSCameraUpdate that zooms out on the map.
 *
 * The zoom increment is -1.0.
 */
+ (GMSCameraUpdate *)zoomOut;

/**
 * Returns a GMSCameraUpdate that changes the zoom by the specified amount.
 */
+ (GMSCameraUpdate *)zoomBy:(float)delta;

/**
 * Returns a GMSCameraUpdate that sets the zoom to the specified amount.
 */
+ (GMSCameraUpdate *)zoomTo:(float)zoom;

/**
 * Returns a GMSCameraUpdate that sets the camera target to the specified coordinate.
 */
+ (GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target;

/**
 * Returns a GMSCameraUpdate that sets the camera target and zoom to the specified values.
 */
+ (GMSCameraUpdate *)setTarget:(CLLocationCoordinate2D)target zoom:(float)zoom;

/**
 * Returns a GMSCameraUpdate that sets the camera to the specified GMSCameraPosition.
 */
+ (GMSCameraUpdate *)setCamera:(GMSCameraPosition *)camera;

/**
 * Returns a GMSCameraUpdate that transforms the camera such that the specified bounds are centered
 * on screen at the greatest possible zoom level. The bounds will have a default padding of 64
 * points.
 *
 * The returned camera update will set the camera's bearing and tilt to their default zero values
 * (i.e., facing north and looking directly at the Earth).
 */
+ (GMSCameraUpdate *)fitBounds:(GMSCoordinateBounds *)bounds;

/**
 * This is similar to fitBounds: but allows specifying the padding (in points) in order to inset the
 * bounding box from the view's edges.
 *
 * If the requested |padding| is larger than the view size in either the vertical or horizontal
 * direction the map will be maximally zoomed out.
 */
+ (GMSCameraUpdate *)fitBounds:(GMSCoordinateBounds *)bounds withPadding:(CGFloat)padding;

/**
 * This is similar to fitBounds: but allows specifying edge insets in order to inset the bounding
 * box from the view's edges.
 *
 * If the requested |edgeInsets| are larger than the view size in either the vertical or horizontal
 * direction the map will be maximally zoomed out.
 */
+ (GMSCameraUpdate *)fitBounds:(GMSCoordinateBounds *)bounds
                withEdgeInsets:(UIEdgeInsets)edgeInsets;

/**
 * Returns a GMSCameraUpdate that shifts the center of the view by the specified number of points in
 * the x and y directions. X grows to the right, Y grows down.
 */
+ (GMSCameraUpdate *)scrollByX:(CGFloat)dX Y:(CGFloat)dY;

/**
 * Returns a GMSCameraUpdate that zooms with a focus point; the focus point stays fixed on screen.
 */
+ (GMSCameraUpdate *)zoomBy:(float)zoom atPoint:(CGPoint)point;

@end

NS_ASSUME_NONNULL_END