Summary: Inherited Constants | Ctors | Methods | Inherited Methods | [Expand All]
public final class

# StreetViewPanoramaOptions

extends Object
implements SafeParcelable Parcelable

java.lang.Object
↳ | com.google.android.gms.maps.StreetViewPanoramaOptions

## Class Overview

Defines configuration PanoramaOptions for a `StreetViewPanorama`. These options can be used when adding a panorama to your application programmatically. If you are using a `StreetViewPanoramaFragment`, you can pass these options in using the static factory method `newInstance(StreetViewPanoramaOptions)`. If you are using a `StreetViewPanoramaView`, you can pass these options in using the constructor `StreetViewPanoramaView(Context, StreetViewPanoramaOptions)`.

## Summary

[Expand] Inherited Constants
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Public Constructors
| StreetViewPanoramaOptions() Creates a new StreetViewPanoramaOptions object.

Public Methods
Boolean | getPanningGesturesEnabled()
String | getPanoramaId()
LatLng | getPosition()
Integer | getRadius()
Boolean | getStreetNamesEnabled()
StreetViewPanoramaCamera | getStreetViewPanoramaCamera()
Boolean | getUseViewLifecycleInFragment()
Boolean | getUserNavigationEnabled()
Boolean | getZoomGesturesEnabled()
StreetViewPanoramaOptions | panningGesturesEnabled(boolean enabled) Toggles the ability for users to use pan around on panoramas using gestures.
StreetViewPanoramaOptions | panoramaCamera(StreetViewPanoramaCamera camera) Specifies the initial camera for the Street View panorama.
StreetViewPanoramaOptions | panoramaId(String panoId) Specifies the initial position for the Street View panorama based on a panorama id.
StreetViewPanoramaOptions | position(LatLng position) Specifies the initial position for the Street View panorama based upon location.
StreetViewPanoramaOptions | position(LatLng position, Integer radius) Specifies the initial position for the Street View panorama based upon location and radius.
StreetViewPanoramaOptions | streetNamesEnabled(boolean enabled) Toggles the ability for users to see street names on panoramas.
StreetViewPanoramaOptions | useViewLifecycleInFragment(boolean useViewLifecycleInFragment) When using a `StreetViewPanoramaFragment`, this flag specifies whether the lifecycle of the Street View panorama should be tied to the fragment's view or the fragment itself.
StreetViewPanoramaOptions | userNavigationEnabled(boolean enabled) Toggles the ability for users to move between panoramas.
void | writeToParcel(Parcel out, int flags)
StreetViewPanoramaOptions | zoomGesturesEnabled(boolean enabled) Toggles the ability for users to zoom on panoramas using gestures.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Public Constructors

#### public StreetViewPanoramaOptions ()

Creates a new StreetViewPanoramaOptions object.

## Public Methods

#### public Boolean getPanningGesturesEnabled ()

##### Returns

- True if users are initially able to pan via gestures on Street View panoramas

#### public String getPanoramaId ()

##### Returns

- The initial panorama ID for the Street View panorama, or null if unspecified.

#### public LatLng getPosition ()

##### Returns

- The initial position for the Street View panorama, or null if unspecified.

#### public Integer getRadius ()

##### Returns

- The initial radius used to search for a Street View panorama, or null if unspecified.

#### public Boolean getStreetNamesEnabled ()

##### Returns

- True if users are initially able to see street names on Street View panoramas

#### public StreetViewPanoramaCamera getStreetViewPanoramaCamera ()

##### Returns

- The initial camera for the Street View panorama, or null if unspecified.

#### public Boolean getUseViewLifecycleInFragment ()

##### Returns

- the useViewLifecycleInFragment option, or null if unspecified.

#### public Boolean getUserNavigationEnabled ()

##### Returns

- True if users are initially able to move to different Street View panoramas

#### public Boolean getZoomGesturesEnabled ()

##### Returns

- True if users are initially able to zoom via gestures on Street View panoramas

#### public StreetViewPanoramaOptions panningGesturesEnabled (boolean enabled)

Toggles the ability for users to use pan around on panoramas using gestures. See `setPanningGesturesEnabled(boolean)` for more details. The default is `true`

#### public StreetViewPanoramaOptions panoramaCamera (StreetViewPanoramaCamera camera)

Specifies the initial camera for the Street View panorama.

#### public StreetViewPanoramaOptions panoramaId (String panoId)

Specifies the initial position for the Street View panorama based on a panorama id. The position set by the panoramaID takes precedence over a position set by a LatLng

#### public StreetViewPanoramaOptions position (LatLng position)

Specifies the initial position for the Street View panorama based upon location. The position set by the panoramaID, if set, takes precedence over a position set by a LatLng

#### public StreetViewPanoramaOptions position (LatLng position, Integer radius)

Specifies the initial position for the Street View panorama based upon location and radius. The position set by the panoramaID, if set, takes precedence over a position set by a LatLng

#### public StreetViewPanoramaOptions streetNamesEnabled (boolean enabled)

Toggles the ability for users to see street names on panoramas. See `setStreetNamesEnabled(boolean)` for more details. The default is `true`

#### public StreetViewPanoramaOptions useViewLifecycleInFragment (boolean useViewLifecycleInFragment)

When using a `StreetViewPanoramaFragment`, this flag specifies whether the lifecycle of the Street View panorama should be tied to the fragment's view or the fragment itself. The default value is `false`, tying the lifecycle of the Street View panorama to the fragment.

Using the lifecycle of the fragment allows faster rendering of the Street View panorama when the fragment is detached and reattached, because the underlying GL context is preserved. This has the cost that detaching the fragment, but not destroying it, will not release memory used by the panorama.

Using the lifecycle of a fragment's view means that a Street View panorama is not reused when the fragment is detached and reattached. This will cause the map to re-render from scratch, which can take a few seconds. It also means that while a fragment is detached, and therefore has no view, all `StreetViewPanorama` methods will throw `NullPointerException`.

#### public StreetViewPanoramaOptions userNavigationEnabled (boolean enabled)

Toggles the ability for users to move between panoramas. See `setUserNavigationEnabled(boolean)` for more details. The default is `true`

#### public void writeToParcel (Parcel out, int flags)

#### public StreetViewPanoramaOptions zoomGesturesEnabled (boolean enabled)

Toggles the ability for users to zoom on panoramas using gestures. See `setZoomGesturesEnabled(boolean)` for more details. The default is `true`