Rendering

StreetViewPanorama class

google.maps.StreetViewPanorama class

Displays the panorama for a givenLatLngor panorama ID. AStreetViewPanoramaobject provides a Street View "viewer" which can be stand-alone within a separate<div>or bound to aMap.

This class extends MVCObject.

Access by callingconst {StreetViewPanorama} = await google.maps.importLibrary( "streetView" ).SeeLibraries in the Maps JavaScript API.

StreetViewPanorama
StreetViewPanorama(container[, opts])
Parameters:
Creates a panorama with the passedStreetViewPanoramaOptions.
controls
Additional controls to attach to the panorama. To add a control to the panorama, add the control's<div>to theMVCArraycorresponding to theControlPositionwhere it should be rendered.
focus
focus()
Parameters:None
Return Value:None
Sets focus on thisStreetViewPanorama.You may wish to consider using this method along with avisible_changedevent to make sure thatStreetViewPanoramais visible before setting focus on it. AStreetViewPanoramathat is not visible cannot be focused.
getLocation
getLocation()
Parameters:None
Return Value:StreetViewLocation
Returns the StreetViewLocation of the current panorama.
getMotionTracking
getMotionTracking()
Parameters:None
Return Value:boolean
Returns the state of motion tracker. Iftruewhen 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:string
Returns 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:StreetViewPov
Returns 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 thepano_changedevent.
getPosition
getPosition()
Parameters:None
Return Value:LatLng|null
Returns the currentLatLngposition for the Street View panorama.
getPov
getPov()
Parameters:None
Return Value:StreetViewPov
Returns the current point of view for the Street View panorama.
getStatus
getStatus()
Parameters:None
Return Value:StreetViewStatus
Returns the status of the panorama on completion of thesetPosition()orsetPano()request.
getVisible
getVisible()
Parameters:None
Return Value:boolean
Returnstrueif the panorama is visible. It does not specify whether Street View imagery is available at the specified position.
getZoom
getZoom()
Parameters:None
Return Value:number
Returns 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.
setMotionTracking
setMotionTracking(motionTracking)
Parameters:
  • motionTracking:boolean
Return Value:None
Sets the state of motion tracker. Iftruewhen 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:
  • pano:string
Return Value:None
Sets the current panorama ID for the Street View panorama.
setPosition
setPosition(latLng)
Parameters:
Return Value:None
Sets the currentLatLngposition 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:
  • flag:boolean
Return Value:None
Sets totrueto make the panorama visible. If set tofalse,the panorama will be hidden whether it is embedded in the map or in its own<div>.
setZoom
setZoom(zoom)
Parameters:
  • zoom:number
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.
Inherited: addListener, bindTo, get, notify, set, setValues, unbind, unbindAll
closeclick
function(event)
Arguments:
  • event:EventThe event triggered.
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 apano_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, viasetPosition()orsetPano().
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, orsetVisible()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 aStreetViewPanoramaobject.

addressControloptional
Type:booleanoptional
The enabled/disabled state of the address control.
addressControlOptionsoptional
The display options for the address control.
clickToGooptional
Type:booleanoptional
Default:true
The enabled/disabled state of click-to-go. Not applicable to custom panoramas.
controlSizeoptional
Type:numberoptional
Size in pixels of the controls appearing on the panorama. This value must be supplied directly when creating the Panorama, updating this value later may bring the controls into an undefined state. Only governs the controls made by the Maps API itself. Does not scale developer created custom controls.
disableDefaultUIoptional
Type:booleanoptional
Enables/disables all default UI. May be overridden individually.
disableDoubleClickZoomoptional
Type:booleanoptional
Default:true
Enables/disables zoom on double click.
enableCloseButtonoptional
Type:booleanoptional
Default:false
Iftrue,the close button is displayed.
fullscreenControloptional
Type:booleanoptional
The enabled/disabled state of the fullscreen control.
fullscreenControlOptionsoptional
The display options for the fullscreen control.
imageDateControloptional
Type:booleanoptional
The enabled/disabled state of the imagery acquisition date control. Disabled by default.
linksControloptional
Type:booleanoptional
The enabled/disabled state of the links control.
motionTrackingoptional
Type:booleanoptional
Whether motion tracking is on or off. Enabled by default when the motion tracking control is present and permission is granted by a user or not required, so that the POV (point of view) follows the orientation of the device. This is primarily applicable to mobile devices. IfmotionTrackingis set tofalsewhilemotionTrackingControlis enabled, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to toggle this option. IfmotionTrackingis set totruewhile permission is required but not yet requested, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to request permission. IfmotionTrackingis set totruewhile permission is denied by a user, the motion tracking control appears disabled with tracking turned off.
motionTrackingControloptional
Type:booleanoptional
The 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.
motionTrackingControlOptionsoptional
The display options for the motion tracking control.
panControloptional
Type:booleanoptional
The enabled/disabled state of the pan control.
panControlOptionsoptional
Type:PanControlOptionsoptional
The display options for the pan control.
panooptional
Type:stringoptional
The panorama ID, which should be set when specifying a custom panorama.
positionoptional
Type:LatLng|LatLngLiteraloptional
TheLatLngposition of the Street View panorama.
povoptional
Type:StreetViewPovoptional
The camera orientation, specified as heading and pitch, for the panorama.
scrollwheeloptional
Type:booleanoptional
Default:true
Iffalse,disables scrollwheel zooming in Street View.
showRoadLabelsoptional
Type:booleanoptional
Default:true
The display of street names on the panorama. If this value is not specified, or is set totrue,street names are displayed on the panorama. If set tofalse,street names are not displayed.
visibleoptional
Type:booleanoptional
Iftrue,the Street View panorama is visible on load.
zoomoptional
Type:numberoptional
The zoom of the panorama, specified as a number. A zoom of 0 gives a 180 degrees Field of View.
zoomControloptional
Type:booleanoptional
The enabled/disabled state of the zoom control.
zoomControlOptionsoptional
Type:ZoomControlOptionsoptional
The display options for the zoom control.

StreetViewAddressControlOptions interface

google.maps.StreetViewAddressControlOptions interface

Options for the rendering of the Street View address control.

positionoptional
Type:ControlPositionoptional
Position id. This id is used to specify the position of the control on the map. The default position isTOP_LEFT.

PanoProviderOptions interface

google.maps.PanoProviderOptions interface

Options for the Custom Pano Provider.

corsoptional
Type:booleanoptional
If set, the renderer will use technologies (like webgl) that only work when cors headers are appropriately 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.

centerHeading
Type:number
The heading (in degrees) at the center of the panoramic tiles.
tileSize
Type:Size
The size (in pixels) at which tiles will be rendered.
worldSize
Type:Size
The size (in pixels) of the whole panorama's "world".
getTileUrl
getTileUrl(pano, tileZoom, tileX, tileY)
Parameters:
  • pano:string
  • tileZoom:number
  • tileX:number
  • tileY:number
Return Value:string
Gets 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:panois the panorama ID of the Street View tile.
tileZoomis the zoom level of the tile.
tileXis the x-coordinate of the tile.
tileYis the y-coordinate of the tile.
Your custom method must return the URL for the tile image.

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.

heading
Type:number
The camera heading in degrees relative totruenorth. True north is 0°, east is 90°, south is 180°, west is 270°.
pitch
Type:number
The 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.

Access by callingconst {StreetViewCoverageLayer} = await google.maps.importLibrary( "streetView" ).SeeLibraries in the Maps JavaScript API.

StreetViewCoverageLayer
StreetViewCoverageLayer()
Parameters:None
Creates a new instance ofStreetViewCoverageLayer.
getMap
getMap()
Parameters:None
Return Value:Map|null
Returns the map on which this layer is displayed.
setMap
setMap(map)
Parameters:
  • map:Mapoptional
Return Value:None
Renders the layer on the specified map. If the map is set to null, the layer will be removed.
Inherited: addListener, bindTo, get, notify, set, setValues, unbind, unbindAll