该对象通常不直接实例化,使用 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.
演示: 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 |
具有以下属性的对象: 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'
})
获取给定制图位置的 panoId。参见 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 的位置。 The position to search for the nearest panoId. | |
radius |
number |
50
|
可选 optional 搜索最近 panoId 的半径(以米为单位)。 The radius in meters to search for the nearest panoId. |
返回: Returns:
包含最近全景图的 panoId、纬度和经度的对象 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);
获取 panoId 的元数据。参见 Gets metadata for panoId. See https://developers.google.com/maps/documentation/tile/streetview#metadata_response 对于响应对象。 for response object.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
panoId |
string |
返回: Returns:
包含 panoId 元数据的对象。 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);
