Overview
A panorama is used to display Street View imagery.
It should be constructed via [[GMSPanoramaView alloc] initWithFrame:], and configured post-initialization.
All properties and methods should be accessed on the main thread, similar to all UIKit objects. The GMSPanoramaViewDelegate methods will also be called back only on the main thread.
The backgroundColor of this view is shown while no panorama is visible, such as while it is loading or if the panorama is later set to nil. The alpha color of backgroundColor is not supported.
Public Member Functions | |
(void) | - setAllGesturesEnabled: |
Sets the preference for whether all gestures should be enabled (default) or disabled. | |
(void) | - animateToCamera:animationDuration: |
Animates the camera of this GMSPanoramaView to camera , over duration (specified in seconds). | |
(void) | - updateCamera:animationDuration: |
Modifies the camera according to cameraUpdate , over duration (specified in seconds). | |
(void) | - moveNearCoordinate: |
Requests a panorama near coordinate . | |
(void) | - moveNearCoordinate:radius: |
Similar to moveNearCoordinate: but allows specifying a search radius (meters) around coordinate . | |
(void) | - moveNearCoordinate:source: |
Similar to moveNearCoordinate: but allows specifying a source near coordinate . | |
(void) | - moveNearCoordinate:radius:source: |
Similar to moveNearCoordinate: but allows specifying a search radius (meters) around coordinate and a source. | |
(void) | - moveToPanoramaID: |
Requests a panorama with panoramaID . | |
(CGPoint) | - pointForOrientation: |
For the current view, returns the screen point the orientation points through. | |
(GMSOrientation) | - orientationForPoint: |
Given a point for this view, returns the current camera orientation pointing through that screen location. | |
Static Public Member Functions | |
(instancetype) | + panoramaWithFrame:nearCoordinate: |
Convenience constructor for GMSPanoramaView, which searches for and displays a GMSPanorama near coordinate . | |
(instancetype) | + panoramaWithFrame:nearCoordinate:radius: |
Similar to panoramaWithFrame:nearCoordinate: but allows specifying a search radius (meters) around coordinate . | |
(instancetype) | + panoramaWithFrame:nearCoordinate:source: |
Convenience constructor for GMSPanoramaView, which searches for and displays a GMSPanorama near coordinate . | |
(instancetype) | + panoramaWithFrame:nearCoordinate:radius:source: |
Convenience constructor for GMSPanoramaView, which searches for and displays a GMSPanorama near coordinate . | |
Properties | |
GMSPanorama * | panorama |
The panorama to display; setting it will transition to a new panorama. | |
IBOutlet id < GMSPanoramaViewDelegate > | delegate |
GMSPanoramaView delegate. | |
BOOL | orientationGestures |
Controls whether orientation gestures are enabled (default) or disabled. | |
BOOL | zoomGestures |
Controls whether zoom gestures are enabled (default) or disabled. | |
BOOL | navigationGestures |
Controls whether navigation gestures are enabled (default) or disabled. | |
BOOL | navigationLinksHidden |
Controls whether the tappable navigation links are hidden or visible (default). | |
BOOL | streetNamesHidden |
Controls whether the street name overlays are hidden or visible (default). | |
GMSPanoramaCamera * | camera |
Controls the panorama's camera. | |
GMSPanoramaLayer * | layer |
Accessor for the custom CALayer type used for the layer. |
Member Function Documentation
- (void) setAllGesturesEnabled: | (BOOL) | enabled |
Sets the preference for whether all gestures should be enabled (default) or disabled.
This does not limit programmatic movement of the camera or control of the panorama.
- (void) animateToCamera: | (GMSPanoramaCamera *) | camera | |
animationDuration: | (NSTimeInterval) | duration | |
Animates the camera of this GMSPanoramaView to camera
, over duration
(specified in seconds).
- (void) updateCamera: | (GMSPanoramaCameraUpdate *) | cameraUpdate | |
animationDuration: | (NSTimeInterval) | duration | |
Modifies the camera according to cameraUpdate
, over duration
(specified in seconds).
- (void) moveNearCoordinate: | (CLLocationCoordinate2D) | coordinate |
Requests a panorama near coordinate
.
Upon successful completion panoramaView:didMoveToPanorama: and panoramaView:didMoveToPanorama:nearCoordinate: will be sent to GMSPanoramaViewDelegate.
On error panoramaView:error:onMoveNearCoordinate: will be sent.
Repeated calls to moveNearCoordinate: result in the previous pending (incomplete) transitions being cancelled -- only the most recent of moveNearCoordinate: and moveToPanoramaId: will proceed and generate events.
- (void) moveNearCoordinate: | (CLLocationCoordinate2D) | coordinate | |
radius: | (NSUInteger) | radius | |
Similar to moveNearCoordinate: but allows specifying a search radius (meters) around coordinate
.
- (void) moveNearCoordinate: | (CLLocationCoordinate2D) | coordinate | |
source: | (GMSPanoramaSource) | source | |
Similar to moveNearCoordinate: but allows specifying a source near coordinate
.
This API is experimental and may not always filter by source.
- (void) moveNearCoordinate: | (CLLocationCoordinate2D) | coordinate | |
radius: | (NSUInteger) | radius | |
source: | (GMSPanoramaSource) | source | |
Similar to moveNearCoordinate: but allows specifying a search radius (meters) around coordinate
and a source.
This API is experimental and may not always filter by source.
- (void) moveToPanoramaID: | (NSString *) | panoramaID |
Requests a panorama with panoramaID
.
Upon successful completion panoramaView:didMoveToPanorama: will be sent to GMSPanoramaViewDelegate.
On error panoramaView:error:onMoveToPanoramaID: will be sent.
Repeated calls to moveToPanoramaID: result in the previous pending (incomplete) transitions being cancelled -- only the most recent of moveNearCoordinate: and moveToPanoramaId: will proceed and generate events.
Only panoramaIDs obtained from the Google Maps SDK for iOS are supported.
- (CGPoint) pointForOrientation: | (GMSOrientation) | orientation |
For the current view, returns the screen point the orientation
points through.
This value may be outside the view for forward facing orientations which are far enough away from straight ahead.
The result will contain NaNs for camera orientations which point away from the view, where the implied screen point would have had a negative distance from the camera in the direction of orientation.
- (GMSOrientation) orientationForPoint: | (CGPoint) | point |
Given a point for this view, returns the current camera orientation pointing through that screen location.
At the center of this view, the returned GMSOrientation will be approximately equal to that of the current GMSPanoramaCamera.
+ (instancetype) panoramaWithFrame: | (CGRect) | frame | |
nearCoordinate: | (CLLocationCoordinate2D) | coordinate | |
Convenience constructor for GMSPanoramaView, which searches for and displays a GMSPanorama near coordinate
.
This performs a similar action to that of moveNearCoordinate:, and will call the same delegate methods.
+ (instancetype) panoramaWithFrame: | (CGRect) | frame | |
nearCoordinate: | (CLLocationCoordinate2D) | coordinate | |
radius: | (NSUInteger) | radius | |
Similar to panoramaWithFrame:nearCoordinate: but allows specifying a search radius (meters) around coordinate
.
+ (instancetype) panoramaWithFrame: | (CGRect) | frame | |
nearCoordinate: | (CLLocationCoordinate2D) | coordinate | |
source: | (GMSPanoramaSource) | source | |
Convenience constructor for GMSPanoramaView, which searches for and displays a GMSPanorama near coordinate
.
This performs a similar action to that of moveNearCoordinate:source, and will call the same delegate methods.
This API is experimental and may not always filter by source.
+ (instancetype) panoramaWithFrame: | (CGRect) | frame | |
nearCoordinate: | (CLLocationCoordinate2D) | coordinate | |
radius: | (NSUInteger) | radius | |
source: | (GMSPanoramaSource) | source | |
Convenience constructor for GMSPanoramaView, which searches for and displays a GMSPanorama near coordinate
.
This performs a similar action to that of moveNearCoordinate:radius:source, and will call the same delegate methods.
This API is experimental and may not always filter by source.
Property Documentation
- (GMSPanorama*) panorama [read, write, assign] |
The panorama to display; setting it will transition to a new panorama.
This is animated, except for the initial panorama.
Can be set to nil to clear the view.
- (IBOutlet id<GMSPanoramaViewDelegate>) delegate [read, write, assign] |
GMSPanoramaView delegate.
- (BOOL) orientationGestures [read, write, assign] |
Controls whether orientation gestures are enabled (default) or disabled.
If enabled, users may use gestures to change the orientation of the camera.
This does not limit programmatic movement of the camera.
- (BOOL) zoomGestures [read, write, assign] |
Controls whether zoom gestures are enabled (default) or disabled.
If enabled, users may pinch to zoom the camera.
This does not limit programmatic movement of the camera.
- (BOOL) navigationGestures [read, write, assign] |
Controls whether navigation gestures are enabled (default) or disabled.
If enabled, users may use a single tap on navigation links or double tap the view to change panoramas.
This does not limit programmatic control of the panorama.
- (BOOL) navigationLinksHidden [read, write, assign] |
Controls whether the tappable navigation links are hidden or visible (default).
Hidden navigation links cannot be tapped.
- (BOOL) streetNamesHidden [read, write, assign] |
Controls whether the street name overlays are hidden or visible (default).
- (GMSPanoramaCamera*) camera [read, write, assign] |
Controls the panorama's camera.
Setting a new camera here jumps to the new camera value, with no animation.
- (GMSPanoramaLayer*) layer [read, retain] |
Accessor for the custom CALayer type used for the layer.