java.lang.Object | |
↳ | com.google.android.gms.maps.StreetViewPanorama |
This is the main class of the Street View feature in the Google Maps Android API and is the
entry point for all methods related to Street View panoramas. You cannot instantiate a
StreetViewPanorama
object directly, rather, you must obtain one from the
#getStreetViewPanoramaAsync()
method on a MapFragment
or MapView
that
you have added to your application.
Note: Similar to a View
object, a StreetViewPanorama
can only
be read and modified from the main thread. Calling StreetViewPanorama
methods from
another thread will result in an exception.
To get started with the Google Maps Android API, read the Google Maps Android API v2 developer guide.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StreetViewPanorama.OnStreetViewPanoramaCameraChangeListener | A listener for when the StreetViewPanoramaCamera changes | ||||||||||
StreetViewPanorama.OnStreetViewPanoramaChangeListener | A listener for when the Street View panorama loads a new panorama | ||||||||||
StreetViewPanorama.OnStreetViewPanoramaClickListener | Callback interface for when the user taps on the panorama. | ||||||||||
StreetViewPanorama.OnStreetViewPanoramaLongClickListener | Callback interface for when the user long presses on the panorama. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Changes the current camera position, orientation and zoom, to a given position over a
specified duration
| |||||||||||
Returns the current location of the user and information regarding the current panorama's
adjacent panoramas
| |||||||||||
Returns the current orientation and zoom
| |||||||||||
Returns whether or not the panning gestures are enabled for the user
| |||||||||||
Returns whether or not the street names appear on the panorama
| |||||||||||
Returns whether or not the navigation is enabled for the user.
| |||||||||||
Returns whether or not the zoom gestures are enabled for the user
| |||||||||||
Returns a screen location that corresponds to an orientation
(
StreetViewPanoramaOrientation ). | |||||||||||
Returns the orientation that corresponds to a screen location.
| |||||||||||
Sets a callback that's invoked when the camera changes
| |||||||||||
Sets a callback that's invoked when the panorama changes
| |||||||||||
Sets a callback that's invoked when the panorama is tapped.
| |||||||||||
Sets a callback that's invoked when the panorama is long-pressed.
| |||||||||||
Sets whether the user is able to use panning gestures
| |||||||||||
Sets the StreetViewPanorama to a given location
| |||||||||||
Sets the StreetViewPanorama to a given location
| |||||||||||
Sets the StreetViewPanorama to a given location
| |||||||||||
Sets whether the user is able to see street names on panoramas
| |||||||||||
Sets whether the user is able to move to another panorama
| |||||||||||
Sets whether the user is able to use zoom gestures
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Changes the current camera position, orientation and zoom, to a given position over a specified duration
Parameters | |
---|---|
camera |
StreetViewPanoramaCamera :
The camera position to animate to |
duration |
long :
The length of time, in milliseconds, it takes to transition from the current
camera position to the given one
|
Returns the current location of the user and information regarding the current panorama's adjacent panoramas
Returns | |
---|---|
StreetViewPanoramaLocation |
The current location of the user |
Returns the current orientation and zoom
Returns | |
---|---|
StreetViewPanoramaCamera |
The current camera |
Returns whether or not the panning gestures are enabled for the user
Returns | |
---|---|
boolean |
true if panning gestures are enabled
|
Returns whether or not the street names appear on the panorama
Returns | |
---|---|
boolean |
true if street names are shown
|
Returns whether or not the navigation is enabled for the user. This includes double tapping as well as using the navigation links
Returns | |
---|---|
boolean |
true if navigation is enabled
|
Returns whether or not the zoom gestures are enabled for the user
Returns | |
---|---|
boolean |
true if zoom gestures are enabled
|
Returns a screen location that corresponds to an orientation
(StreetViewPanoramaOrientation
). The screen location is in screen pixels
(not display pixels) relative to the top left of the Street View panorama
(not of the whole screen).
Parameters | |
---|---|
orientation |
StreetViewPanoramaOrientation :
A StreetViewPanoramaOrientation on the Street View panorama to
convert to a screen location. |
Returns | |
---|---|
Point |
A Point representing the screen location in screen pixels. Returns
null if the orientation is unable to be projected on the screen (e.g. behind
the user's field of view)
|
Returns the orientation that corresponds to a screen location. The screen location is specified in screen pixels (not display pixels) relative to the top left of the Street View panorama (not the top left of the whole screen).
Parameters | |
---|---|
point |
Point :
A Point on the screen in screen pixels. |
Returns | |
---|---|
StreetViewPanoramaOrientation |
The StreetViewPanoramaOrientation corresponding to the point on the
screen, or null if the Street View panorama has not been initialized or if
the given point is not a valid point on the screen
|
Sets a callback that's invoked when the camera changes
Parameters | |
---|---|
listener |
StreetViewPanorama.OnStreetViewPanoramaCameraChangeListener :
The callback that's invoked when the camera changes. To unset the callback,
use null .
|
Sets a callback that's invoked when the panorama changes
Parameters | |
---|---|
listener |
StreetViewPanorama.OnStreetViewPanoramaChangeListener :
The callback that's invoked when the panorama changes. To unset the callback,
use null .
|
Sets a callback that's invoked when the panorama is tapped.
Parameters | |
---|---|
listener |
StreetViewPanorama.OnStreetViewPanoramaClickListener :
The callback that's invoked when the panorama is tapped. To unset the
callback, use null .
|
Sets a callback that's invoked when the panorama is long-pressed.
Parameters | |
---|---|
listener |
StreetViewPanorama.OnStreetViewPanoramaLongClickListener :
The callback that's invoked when the panorama is long-pressed. To unset
the callback, use null .
|
Sets whether the user is able to use panning gestures
Parameters | |
---|---|
enablePanning |
boolean :
true if users are allowed to use panning gestures
|
Sets the StreetViewPanorama to a given location
Parameters | |
---|---|
position |
LatLng :
Latitude and longitude of the desired location
|
Sets the StreetViewPanorama to a given location
Parameters | |
---|---|
position |
LatLng :
Latitude and longitude of the desired location |
radius |
int :
Radius, specified in meters, that defines the area in which to search for a
panorama, centered on the given latitude and longitude
|
Sets the StreetViewPanorama to a given location
Parameters | |
---|---|
panoId |
String :
Panorama ID of the desired location
|
Sets whether the user is able to see street names on panoramas
Parameters | |
---|---|
enableStreetNames |
boolean :
true if users are able to see street names on panoramas
|
Sets whether the user is able to move to another panorama
Parameters | |
---|---|
enableUserNavigation |
boolean :
true if users are allowed to move to another panorama
|
Sets whether the user is able to use zoom gestures
Parameters | |
---|---|
enableZoom |
boolean :
true if users are allowed to use zoom gestures
|