StreetViewPanorama class
google.maps.StreetViewPanorama
class
Displays the panorama for a given LatLng or panorama ID. A StreetViewPanorama object provides a Street View "viewer" which can be stand-alone within a separate <div> or bound to a Map.
This class extends
MVCObject.
| Constructor | |
|---|---|
StreetViewPanorama |
StreetViewPanorama(container[, opts])Parameters:
Creates a panorama with the passed StreetViewPanoramaOptions. |
| Methods | |
|---|---|
getLinks |
getLinks()Parameters: None
Return Value:
Array<StreetViewLink>Returns the set of navigation links for the Street View panorama. |
getLocation |
getLocation()Parameters: None
Return Value:
StreetViewLocationReturns the StreetViewLocation of the current panorama. |
getMotionTracking |
getMotionTracking()Parameters: None
Return Value:
booleanReturns the state of motion tracker. If true when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements. |
getPano |
getPano()Parameters: None
Return Value:
stringReturns the current panorama ID for the Street View panorama. This id is stable within the browser's current session only. |
getPhotographerPov |
getPhotographerPov()Parameters: None
Return Value:
StreetViewPovReturns the heading and pitch of the photographer when this panorama was taken. For Street View panoramas on the road, this also reveals in which direction the car was travelling. This data is available after the pano_changed event. |
getPosition |
getPosition()Parameters: None
Return Value:
LatLngReturns the current LatLng position for the Street View panorama. |
getPov |
getPov()Parameters: None
Return Value:
StreetViewPovReturns the current point of view for the Street View panorama. |
getStatus |
getStatus()Parameters: None
Return Value:
StreetViewStatusReturns the status of the panorama on completion of the setPosition() or setPano() request. |
getVisible |
getVisible()Parameters: None
Return Value:
booleanReturns true if the panorama is visible. It does not specify whether Street View imagery is available at the specified position. |
getZoom |
getZoom()Parameters: None
Return Value:
numberReturns the zoom level of the panorama. Fully zoomed-out is level 0, where the field of view is 180 degrees. Zooming in increases the zoom level. |
registerPanoProvider |
registerPanoProvider(provider[, opt_options])Parameters:
Return Value: None
Set the custom panorama provider called on pano change to load custom panoramas. |
setLinks |
setLinks(links)Parameters:
Return Value: None
Sets the set of navigation links for the Street View panorama. |
setMotionTracking |
setMotionTracking(motionTracking)Parameters:
Return Value: None
Sets the state of motion tracker. If true when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements. |
setOptions |
setOptions(options)Parameters:
Return Value: None
Sets a collection of key-value pairs. |
setPano |
setPano(pano)Parameters:
Return Value: None
Sets the current panorama ID for the Street View panorama. |
setPosition |
setPosition(latLng)Parameters:
Return Value: None
Sets the current LatLng position for the Street View panorama. |
setPov |
setPov(pov)Parameters:
Return Value: None
Sets the point of view for the Street View panorama. |
setVisible |
setVisible(flag)Parameters:
Return Value: None
Sets to true to make the panorama visible. If set to false, the panorama will be hidden whether it is embedded in the map or in its own <div>. |
setZoom |
setZoom(zoom)Parameters:
Return Value: None
Sets the zoom level of the panorama. Fully zoomed-out is level 0, where the field of view is 180 degrees. Zooming in increases the zoom level. |
| Properties | |
|---|---|
controls |
Type:
Array<MVCArray<Node>>Additional controls to attach to the panorama. To add a control to the panorama, add the control's <div> to the MVCArray corresponding to the ControlPosition where it should be rendered. |
| Events | |
|---|---|
closeclick |
function(event)Arguments:
This event is fired when the close button is clicked. |
pano_changed |
function()Arguments: None
This event is fired when the panorama's pano id changes. The pano may change as the user navigates through the panorama or the position is manually set. Note that not all position changes trigger a pano_changed. |
position_changed |
function()Arguments: None
This event is fired when the panorama's position changes. The position changes as the user navigates through the panorama or the position is set manually. |
pov_changed |
function()Arguments: None
This event is fired when the panorama's point-of-view changes. The point of view changes as the pitch, zoom, or heading changes. |
resize |
function()Arguments: None
Developers should trigger this event on the panorama when its div changes size: google.maps.event.trigger(panorama, 'resize'). |
status_changed |
function()Arguments: None
This event is fired after every panorama lookup by id or location, via setPosition() or setPano(). |
visible_changed |
function()Arguments: None
This event is fired when the panorama's visibility changes. The visibility is changed when the Pegman is dragged onto the map, the close button is clicked, or setVisible() is called. |
zoom_changed |
function()Arguments: None
This event is fired when the panorama's zoom level changes. |
StreetViewPanoramaOptions interface
google.maps.StreetViewPanoramaOptions
interface
Options defining the properties of a StreetViewPanorama object.
| Properties | |
|---|---|
addressControl |
Type:
booleanThe enabled/disabled state of the address control. |
addressControlOptions |
The display options for the address control. |
clickToGo |
Type:
booleanThe enabled/disabled state of click-to-go. |
disableDefaultUI |
Type:
booleanEnables/disables all default UI. May be overridden individually. |
disableDoubleClickZoom |
Type:
booleanEnables/disables zoom on double click. Disabled by default. |
enableCloseButton |
Type:
booleanIf true, the close button is displayed. Disabled by default. |
fullscreenControl |
Type:
booleanThe enabled/disabled state of the fullscreen control. |
fullscreenControlOptions |
Type:
FullscreenControlOptionsThe display options for the fullscreen control. |
imageDateControl |
Type:
booleanThe enabled/disabled state of the imagery acquisition date control. Disabled by default. |
linksControl |
Type:
booleanThe enabled/disabled state of the links control. |
motionTracking |
Type:
booleanWhether motion tracking is on or off. Enabled by default when the motion tracking control is present, so that the POV (point of view) follows the orientation of the device. This is primarily applicable to mobile devices. If motionTracking is set to false while motionTrackingControl is enabled, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to toggle this option. |
motionTrackingControl |
Type:
booleanThe enabled/disabled state of the motion tracking control. Enabled by default when the device has motion data, so that the control appears on the map. This is primarily applicable to mobile devices. |
motionTrackingControlOptions |
The display options for the motion tracking control. |
panControl |
Type:
booleanThe enabled/disabled state of the pan control. |
panControlOptions |
Type:
PanControlOptionsThe display options for the pan control. |
pano |
Type:
stringThe panorama ID, which should be set when specifying a custom panorama. |
position |
Type:
LatLng|LatLngLiteralThe LatLng position of the Street View panorama. |
pov |
Type:
StreetViewPovThe camera orientation, specified as heading and pitch, for the panorama. |
scrollwheel |
Type:
booleanIf false, disables scrollwheel zooming in Street View. The scrollwheel is enabled by default. |
showRoadLabels |
Type:
booleanThe display of street names on the panorama. If this value is not specified, or is set to true, street names are displayed on the panorama. If set to false, street names are not displayed. |
visible |
Type:
booleanIf true, the Street View panorama is visible on load. |
zoom |
Type:
numberThe zoom of the panorama, specified as a number. A zoom of 0 gives a 180 degrees Field of View. |
zoomControl |
Type:
booleanThe enabled/disabled state of the zoom control. |
zoomControlOptions |
Type:
ZoomControlOptionsThe display options for the zoom control. |
StreetViewAddressControlOptions interface
google.maps.StreetViewAddressControlOptions
interface
Options for the rendering of the Street View address control.
| Properties | |
|---|---|
position |
Type:
ControlPositionPosition id. This id is used to specify the position of the control on the map. The default position is TOP_LEFT. |
PanoProviderOptions interface
google.maps.PanoProviderOptions
interface
Options for the Custom Pano Provider.
| Properties | |
|---|---|
cors |
Type:
booleanIf set, the renderer will use technologies (like webgl) that only work when cors headers are appropiately set on the provided images. It is the developer's task to serve the images correctly in combination with this flag, which might otherwise lead to SecurityErrors. |
StreetViewTileData interface
google.maps.StreetViewTileData
interface
The properties of the tile set used in a Street View panorama.
| Methods | |
|---|---|
getTileUrl |
getTileUrl(pano, tileZoom, tileX, tileY)Parameters:
Return Value:
stringGets the tile image URL for the specified tile. This is a custom method which you must implement, to supply your custom tiles. The API calls this method, supplying the following parameters: pano is the panorama ID of the Street View tile.tileZoom is the zoom level of the tile.tileX is the x-coordinate of the tile.tileY is the y-coordinate of the tile.Your custom method must return the URL for the tile image. |
| Properties | |
|---|---|
centerHeading |
Type:
numberThe heading (in degrees) at the center of the panoramic tiles. |
tileSize |
Type:
SizeThe size (in pixels) at which tiles will be rendered. |
worldSize |
Type:
SizeThe size (in pixels) of the whole panorama's "world". |
StreetViewPov interface
google.maps.StreetViewPov
interface
A point of view object which specifies the camera's orientation at the Street View panorama's position. The point of view is defined as heading and pitch.
| Properties | |
|---|---|
heading |
Type:
numberThe camera heading in degrees relative to true north. True north is 0°, east is 90°, south is 180°, west is 270°. |
pitch |
Type:
numberThe camera pitch in degrees, relative to the street view vehicle. Ranges from 90° (directly upwards) to -90° (directly downwards). |
StreetViewCoverageLayer class
google.maps.StreetViewCoverageLayer
class
A layer that illustrates the locations where Street View is available.
This class extends
MVCObject.
| Constructor | |
|---|---|
StreetViewCoverageLayer |
StreetViewCoverageLayer()Parameters: None
Creates a new instance of StreetViewCoverageLayer. |
| Methods | |
|---|---|
getMap |
getMap()Parameters: None
Return Value:
MapReturns the map on which this layer is displayed. |
setMap |
setMap(map)Parameters:
Return Value: None
Renders the layer on the specified map. If the map is set to null, the layer will be removed. |