This object is normally not instantiated directly, use
Creates a GoogleStreetViewCubeMapPanoramaProvider.fromUrl.
PanoramaProvider which provides imagery from Google Street View Static API to be displayed in a panorama.
Methods
static Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl(options) → Promise.<GoogleStreetViewCubeMapPanoramaProvider>
Creates a
PanoramaProvider which provides cube face images from the Google Street View Static API.
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
Returns:
A promise that resolves to the created GoogleStreetViewCubeMapPanoramaProvider.'
Example:
const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({
key: 'your Google Streetview Static api key'
})
Gets the panoIds for the given cartographic location. See https://developers.google.com/maps/documentation/tile/streetview#panoid-search.
| Name | Type | Default | Description |
|---|---|---|---|
position |
Cartographic | The position to search for the nearest panoId. | |
radius |
number |
50
|
optional The radius in meters to search for the nearest panoId. |
Returns:
an object containing a panoId, latitude, and longitude of the closest panorama
Example:
const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({
key: 'your Google Streetview Static api key'
})
const panoIds = provider.getNearestPanoId(position);
Gets metadata for panoId. See https://developers.google.com/maps/documentation/tile/streetview#metadata_response for response object.
| Name | Type | Description |
|---|---|---|
panoId |
string |
Returns:
object containing metadata for the panoId.
Example:
const panoIdObject = provider.getNearestPanoId(position);
const panoIdMetadata = provider.getPanoIdMetadata(panoIdObject.panoId);
loadPanorama(options) → CubeMapPanorama
Gets the panorama primitive for a requested position and orientation.
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
Returns:
The panorama primitive textured with imagery.
Example:
const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({
key: 'your Google Streetview Static api key'
})
const panoIdObject = provider.getNearestPanoId(position);
const position = Cartographic.fromDegrees(panoIdObject.location.lng, panoIdObject.location.lat, 0);
const primitive = await provider.loadPanorama({
cartographic: position,
panoId: panoIdObject.panoId
});
viewer.scene.primitive.add(primitive);
