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
.
Access by calling const {StreetViewPanorama} = await google.maps.importLibrary("streetView")
.See Libraries in the Maps JavaScript API
.
Constructor
StreetViewPanorama(container[, opts])
-
container
:HTMLElement
-
opts
:StreetViewPanoramaOptions optional
StreetViewPanoramaOptions
. Properties |
|
---|---|
controls
|
Type:
Array
< MVCArray
< HTMLElement
>>
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. |
Methods
focus()
StreetViewPanorama
. You may wish to consider using this method along with a visible_changed
event to make sure that StreetViewPanorama
is visible before setting focus on it. A StreetViewPanorama
that is not visible cannot be focused.getLinks()
Array
< StreetViewLink
>
getLocation()
StreetViewLocation
getMotionTracking()
boolean
true
when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements.getPano()
string
getPhotographerPov()
StreetViewPov
pano_changed
event.getPosition()
LatLng
|null
LatLng
position for the Street View panorama.getPov()
StreetViewPov
getStatus()
StreetViewStatus
setPosition()
or setPano()
request.getVisible()
boolean
true
if the panorama is visible. It does not specify whether Street View imagery is available at the specified position.getZoom()
number
registerPanoProvider(provider[, opt_options])
-
provider
:function(string): ( StreetViewPanoramaData optional )
-
opt_options
:PanoProviderOptions optional
setLinks(links)
-
links
:Array < StreetViewLink >
setMotionTracking(motionTracking)
-
motionTracking
:boolean
true
when the user physically moves the device and the browser supports it, the Street View Panorama tracks the physical movements.setOptions(options)
-
options
:StreetViewPanoramaOptions optional
setPano(pano)
-
pano
:string
setPosition(latLng)
-
latLng
:LatLng | LatLngLiteral optional
LatLng
position for the Street View panorama.setPov(pov)
-
pov
:StreetViewPov
setVisible(flag)
-
flag
:boolean
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(zoom)
-
zoom
:number
Events
function(event)
-
event
:Event
The event triggered.
function()
pano_changed
.function()
function()
function()
google.maps.event.trigger
(panorama, 'resize')
.function()
setPosition()
or setPano()
.function()
setVisible()
is called.function()
StreetViewPanoramaOptions interface
google.maps
. StreetViewPanoramaOptions
interface
Options defining the properties of a StreetViewPanorama
object.
Properties |
|
---|---|
addressControl
optional
|
Type:
boolean optional
The enabled/disabled state of the address control.
|
addressControlOptions
optional
|
Type:
StreetViewAddressControlOptions
optional
The display options for the address control.
|
clickToGo
optional
|
Type:
boolean optional
Default:
true
The enabled/disabled state of click-to-go. Not applicable to custom panoramas.
|
controlSize
optional
|
Type:
number optional
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.
|
disableDefaultUI
optional
|
Type:
boolean optional
Enables/disables all default UI. May be overridden individually.
|
disableDoubleClickZoom
optional
|
Type:
boolean optional
Default:
true
Enables/disables zoom on double click.
|
enableCloseButton
optional
|
Type:
boolean optional
Default:
false
If
true
, the close button is displayed. |
fullscreenControl
optional
|
Type:
boolean optional
The enabled/disabled state of the fullscreen control.
|
fullscreenControlOptions
optional
|
Type:
FullscreenControlOptions
optional
The display options for the fullscreen control.
|
imageDateControl
optional
|
Type:
boolean optional
The enabled/disabled state of the imagery acquisition date control. Disabled by default.
|
linksControl
optional
|
Type:
boolean optional
The enabled/disabled state of the links control.
|
motionTracking
optional
|
Type:
boolean optional
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. 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. If motionTracking
is set to true
while 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. If motionTracking
is set to true
while permission is denied by a user, the motion tracking control appears disabled with tracking turned off. |
motionTrackingControl
optional
|
Type:
boolean optional
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.
|
motionTrackingControlOptions
optional
|
Type:
MotionTrackingControlOptions
optional
The display options for the motion tracking control.
|
panControl
optional
|
Type:
boolean optional
The enabled/disabled state of the pan control.
|
panControlOptions
optional
|
Type:
PanControlOptions
optional
The display options for the pan control.
|
pano
optional
|
Type:
string optional
The panorama ID, which should be set when specifying a custom panorama.
|
position
optional
|
Type:
LatLng
| LatLngLiteral
optional
The
LatLng
position of the Street View panorama. |
pov
optional
|
Type:
StreetViewPov
optional
The camera orientation, specified as heading and pitch, for the panorama.
|
scrollwheel
optional
|
Type:
boolean optional
Default:
true
If
false
, disables scrollwheel zooming in Street View. |
showRoadLabels
optional
|
Type:
boolean optional
Default:
true
The 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
optional
|
Type:
boolean optional
If
true
, the Street View panorama is visible on load. |
zoom
optional
|
Type:
number optional
The zoom of the panorama, specified as a number. A zoom of 0 gives a 180 degrees Field of View.
|
zoomControl
optional
|
Type:
boolean optional
The enabled/disabled state of the zoom control.
|
zoomControlOptions
optional
|
Type:
ZoomControlOptions
optional
The display options for the zoom control.
|
StreetViewAddressControlOptions interface
google.maps
. StreetViewAddressControlOptions
interface
Options for the rendering of the Street View address control.
Properties |
|
---|---|
position
optional
|
Type:
ControlPosition
optional
Position 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
optional
|
Type:
boolean optional
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.
Properties |
|
---|---|
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".
|
Methods
getTileUrl(pano, tileZoom, tileX, tileY)
-
pano
:string
-
tileZoom
:number
-
tileX
:number
-
tileY
:number
string
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.
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:
number
The camera heading in degrees relative to
true
north. 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 calling const {StreetViewCoverageLayer} = await google.maps.importLibrary("streetView")
.See Libraries in the Maps JavaScript API
.
Constructor |
|
---|---|
StreetViewCoverageLayer
|
StreetViewCoverageLayer()
Parameters: None
Creates a new instance of
StreetViewCoverageLayer
. |