loadPanorama

Gets the panorama primitive for a requested position and orientation.

const provider = await 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);

Return

The panorama primitive textured with imagery.

See also