new Cesium.GoogleStreetViewCubeMapPanoramaProvider()

此天体通常不直接即时化,使用 GoogleStreetViewCubeMapPanoramaProvider.fromUrl .
Creates a PanoramaProvider which provides imagery from Google Street View Static API to be displayed in a panorama.
Demo:
See:

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 下列属性的对象 :
Name Type Default Description
key string GoogleMaps.defaultStreetViewStaticApiKey optional Your API key to access Google Street View Static API. See https://developers.google.com/maps/documentation/javascript/get-api-key for instructions on how to create your own key. If undefined, defaults to GoogleMaps.defaultStreetViewStaticApiKey. If that value is unavailable, falls back to GoogleMaps.defaultApiKey.
url string | Resource GoogleMaps.streetViewStaticApiEndpoint optional The URL to access Google Street View Static API. See https://developers.google.com/maps/documentation/streetview/overview for more information.
tileSize number 600 optional 每一平方瓦的默认宽度和高度(像素).
credit Credit | string optional 数据源的信用,在画布上显示.
Returns:
一个能解决GoogleStreetViewCubeMapPanorama Provider的诺言
Example:
const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({
  key: 'your Google Streetview Static api key'
})

getNearestPanoId(position, radius)Object

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 搜索最近的panoId的位置 .
radius number 50 optional 以米为单位的半径以搜索最近的panoId.
Returns:
含有最接近全景的斜体、纬度和经度的天体
Example:
const provider = await Cesium.GoogleStreetViewCubeMapPanoramaProvider.fromUrl({
  key: 'your Google Streetview Static api key'
})
const panoIds = provider.getNearestPanoId(position);

getPanoIdMetadata(panoId)object

Name Type Description
panoId string
Returns:
包含 panoId 元数据的对象.
Example:
const panoIdObject = provider.getNearestPanoId(position);
const panoIdMetadata = provider.getPanoIdMetadata(panoIdObject.panoId);

loadPanorama(options)CubeMapPanorama

获得全景原始的求位置和方向 .
Name Type Description
options object 下列属性的对象 :
Name Type Description
cartographic Cartographic 将全景布置在现场的位置.
panoId string optional Google NT 0 中的图像全景标识符. 如果不提供,则将查找所提供的地图位置.
tileSize number optional 可选的瓦片大小覆盖( 平方) .
signature string optional Optional signature for signed URLs. See https://developers.google.com/maps/documentation/streetview/digital-signature for more information.
credit Credit | string optional 数据源的信用,在画布上显示.
Returns:
全景的原始文字 带有图像.
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);
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.