Select platform: [Android](https://developers.google.com/maps/documentation/android-sdk/streetview.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/ios-sdk/streetview.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/streetview.md.txt "View this page for the JavaScript platform docs.")

<br />

![](https://developers.google.com/static/maps/images/streetview-ios.png)

Google Maps Street View lets you explore places around the world through
360-degree, street-level imagery. You can explore world landmarks, view natural
wonders, navigate a trip, or show the outside of your business.

> [!IMPORTANT]
> **Paid feature:**
> Although calls to the Maps SDK for iOS are not charged, calls to the
> Dynamic Street View feature will incur charges.
> For more details, see
> [Google Maps Platform SKU details](https://developers.google.com/maps/billing-and-pricing/sku-details/maps.md.txt#dynamic-street-view-pro-sku).

## Overview

Google Street View provides panoramic 360-degree views
from designated roads throughout its coverage area. The coverage available
through the SDK is the same as that for the [Google Maps for iOS
app](https://itunes.apple.com/app/id585027354) or
[`https://maps.google.com/`](http://maps.google.com/). You
can read more about Street View and see the supported
areas on an interactive map, at [About Street View](https://www.google.com/maps/about/behind-the-scenes/streetview/#where)
.

The Maps SDK for iOS provides a Street View
service for obtaining and manipulating the imagery used in Google Maps
Street View. Street View images
are returned as panoramas and are viewed from within the
Street View viewer --- an object of type
[`GMSPanoramaView`](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSPanoramaView.md.txt).

## Street View panoramas

Each Street View panorama is an image, or set of images,
that provides a full 360-degree view from a single location. Images conform to
the equirectangular (Plate Carrée) projection, which contains 360 degrees of
horizontal view (a full wrap-around) and 180 degrees of vertical view (from
straight up to straight down). The resulting 360 degree panorama defines a
projection on a sphere with the image wrapped to the two-dimensional surface of
that sphere.

Street View panoramas are viewable with the
`GMSPanoramaView` object. This object provides a viewer that will render the
panorama as a sphere, with a camera at its center. You can programmatically
control the orientation of the camera, as well as several properties customizing
the viewer.

### Access Street View data

Street View panoramas are identified by one of two
pieces of metadata:

`panoramaID`
:   The unique ID of a Street View panorama. This
    `panoramaID`
    may change over time, and is not suitable as a long term, or hard-coded,
    reference. The `panoramaID` is best used to provide
    programmatic access to different Street View images.

`coordinate`
:   The precise location of this image, expressed as a
    `CLLocationCoordinate2D`. Use a `coordinate` for
    persistent storage of a panorama location, or to translate user actions on
    the map into a Street View image.

Both the `panoramaID` and the `coordinate` are stored as properties of the
`GMSPanorama` object. You can request a `GMSPanorama` from the
`GMSPanoramaService` using either the `coordinate` or `panoramaID`. The
resulting object will include both pieces of meta-data, as well as an array of
links to nearby panoramas.

### Set the location of the panorama

The location of the Street View panorama can be set
based on the coordinate.

- The `moveNearCoordinate` method requests a panorama near the
  coordinate.

- The `moveNearCoordinate:radius` method is similar, but lets you
  specify a search radius, in meters, around the coordinate.

- The `moveNearCoordinate:source` method lets you specify a source.
  A source is useful if you want to restrict Street View
  to only look for
  panoramas which are outside. By default, panoramas of locations are either
  inside or outside. Note that outdoor panoramas may not exist for the
  specified location.

- The `moveNearCoordinate:radius:source` method lets you specify both a
  radius and a source.

## Viewing Street View images

### Adding a Street View viewer

The basic steps for adding a viewer are:

1. **(Once)** Follow the steps in [Getting Started](https://developers.google.com/maps/documentation/ios-sdk/config.md.txt) to get the SDK, obtain a key and add the required frameworks.
2. Create or update a `ViewController`. If the panorama will be displayed when this view controller becomes visible, be sure to create it within the `loadView` method.
3. Create and instantiate a `GMSPanoramaView` class using the `GMSPanoramaView` `initWithFrame:` method. If this is to be used as the view controller's only view, then `CGRectZero` could be used as the map's frame --- the map will be resized automatically.
4. Set the `GMSPanoramaView` object as the view controller's view. For example, `self.view = panoView;`.
5. Set the location of the Street View image using a method such as `moveNearCoordinate:`.

The below example adds a Street View viewer to an app.


### Swift

```swift
import GoogleMaps

class StreetView: UIViewController {

  override func loadView() {
    let panoView = GMSPanoramaView(frame: .zero)
    self.view = panoView

    panoView.moveNearCoordinate(CLLocationCoordinate2D(latitude: -33.732, longitude: 150.312))
  }
}
      
```

### Objective-C

```objective-c
#import "StreetView.h"
@import GoogleMaps;

@interface StreetView ()

@end

@implementation StreetView

- (void)loadView {
  GMSPanoramaView *panoView = [[GMSPanoramaView alloc] initWithFrame:CGRectZero];
  self.view = panoView;

  [panoView moveNearCoordinate:CLLocationCoordinate2DMake(-33.732, 150.312)];
}

@end
      
```

<br />

### Customize the viewer

You can customize the viewer by restricting which gestures are available. By
default, panning, zooming and traveling to adjacent panoramas are all enabled.
Individual gestures are controlled through properties of `GMSPanoramaView`.
These properties enable or disable user controlled gestures; programmatic
changes are still possible when the gesture is disabled.

`orientationGestures`
:   Whether the user will be able to re-orient the camera by tapping or
    dragging. Set to `NO` to disable orientation changes to the
    camera.

`zoomGestures`
:   Whether the user will be able to pinch to zoom. Set to `NO`
    to disable zoom.

`navigationGestures`
:   Whether the user will be able to change which panorama is visible. Users
    may use a single tap on navigation links or double tap the view to change
    panoramas Set to `NO` to disable navigation changes.

You can enable or disable all of the gestures at once with the
`setAllGesturesEnabled:` method.


### Swift

```swift
panoView.setAllGesturesEnabled(false)
      
```

### Objective-C

```objective-c
[panoView setAllGesturesEnabled:NO];
      
```

<br />

### Launching Street View with the URL Scheme

Google Street View imagery is viewable from within the Google Maps for iOS
application. You can launch the Google Maps for iOS application in street
view mode with the `comgooglemaps` URL Scheme by setting the `mapmode`
parameter to `streetview`. An example of a URL that will launch Street View
appears below. For more information, refer to the [URL Scheme](https://developers.google.com/maps/documentation/ios-sdk/urlscheme.md.txt)
documentation.

    comgooglemaps://?center=46.414382,10.013988&mapmode=streetview

## Street View locations and point-of-view (POV)

The `GMSPanoramaCamera` allows you to set the point-of-view of the Street View
camera as a combination of heading, pitch and zoom.

The below snippet sets will orient the camera south, and slightly downwards.


### Swift

```swift
panoView.camera = GMSPanoramaCamera(heading: 180, pitch: -10, zoom: 1)
      
```

### Objective-C

```objective-c
panoView.camera = [GMSPanoramaCamera cameraWithHeading:180
                                                 pitch:-10
                                                  zoom:1];
      
```

<br />

### Orientation

The Street View location defines the placement of the camera focus for an
image, but it does not define the orientation of the camera for that image.
For that purpose, the `GMSOrientation` object defines two properties:

- `heading` defines the rotation angle around the camera locus in degrees relative from true north. Headings are measured clockwise: true north is 0, east is 90, south is 180, west is 270.
- `pitch` (default `0`) defines the angle variance "up" or "down" from the camera's initial default pitch, which is often (but not always) flat horizontal. (For example, an image taken on a hill will likely exhibit a default pitch that is not horizontal.) Pitch angles are measured with positive values looking up (to +90 degrees straight up and orthogonal to the default pitch) and negative values looking down (to -90 degrees straight down and orthogonal to the default pitch).

### Zoom

Street View supports different levels of image detail through the use of zoom.
You can set the zoom level programmatically, or users can change the level in
the viewer by pinching to zoom.

### Moving the camera

Once you've created the `GMSPanoramaView`, and it has either a configured or
default camera, you can change it in one of several ways. When you change the
camera, you have the option of animating the resulting camera movement. The
animation interpolates between the current camera attributes and the new
camera attributes.

You can modify the `GMSPanoramaCamera` object, and set it on the
`GMSPanoramaView`'s `camera` property. This will snap the camera to the new
point of view with no animation. A `GMSCameraPosition` may be created to configure
any combination of orientation and zoom.


### Swift

```swift
panoView.camera = GMSPanoramaCamera(heading: 180, pitch: -10, zoom: 1)
      
```

### Objective-C

```objective-c
panoView.camera = [GMSPanoramaCamera cameraWithHeading:180
                                                 pitch:-10
                                                  zoom:1];
      
```

<br />

You can animate a transition by calling the
`animateToCamera:animationDuration:` method of `GMSPanoramaView`.
Additionally, you can control the camera using Core Animation. This is made
available through the custom `CALayer` on `GMSPanoramaView`,
`GMSPanoramaLayer`.

## Markers within Street View

The `GMSPanoramaView` object is able to display map markers. You can use the
same `GMSMarker` object on either a `GMSMapView` or a
`GMSPanoramaView` object by setting its corresponding properties:


### Swift

```swift
// Create a marker at the Eiffel Tower
let position = CLLocationCoordinate2D(latitude: 48.858, longitude: 2.294)
let marker = GMSMarker(position: position)

// Add the marker to a GMSPanoramaView object named panoView
marker.panoramaView = panoView

// Add the marker to a GMSMapView object named mapView
marker.map = mapView
      
```

### Objective-C

```objective-c
// Create a marker at the Eiffel Tower
CLLocationCoordinate2D position = CLLocationCoordinate2DMake(48.858,2.294);
GMSMarker *marker = [GMSMarker markerWithPosition:position];

// Add the marker to a GMSPanoramaView object named panoView
marker.panoramaView = panoView;

// Add the marker to a GMSMapView object named mapView
marker.map = mapView;
      
```

<br />

Markers will scale in size as a function of the distance between the marker's
position and the `GMSCameraView`'s location. If this distance becomes too
great, the marker will become too small to display and will be hidden from
view.

> [!NOTE]
> **Note:** Not all marker features are available when using GMSPanoramaView.

Set the `panoramaView` property to `nil` to remove it from the
`GMSPanoramaView`.


### Swift

```swift
marker.panoramaView = nil
      
```

### Objective-C

```objective-c
marker.panoramaView = nil;
      
```

<br />

## Events

You can listen to events that occur on the Street View panorama, such as when a
user taps on the panorama. To listen to events, you must implement the
[`GMSPanoramaViewDelegate`](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSPanoramaViewDelegate.md.txt) protocol. See the overall
[guide to events](https://developers.google.com/maps/documentation/ios-sdk/events.md.txt) and the list of methods on the
[`GMSPanoramaViewDelegate`](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Protocols/GMSPanoramaViewDelegate.md.txt).