要构造 BingMapsImageryProvider,请调用 To construct a BingMapsImageryProvider, call
使用 Bing 地图图像 REST API 提供平铺图像。 Provides tiled imagery using the Bing Maps Imagery REST API.
BingMapsImageryProvider.fromUrl。不要直接调用构造函数。 . Do not call the constructor directly.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
options |
BingMapsImageryProvider.ConstructorOptions | 描述初始化选项的对象 Object describing initialization options |
- BingMapsImageryProvider.fromUrl
- ArcGisMapServerImageryProvider
- GoogleEarthEnterpriseMapsProvider
- OpenStreetMapImageryProvider
- SingleTileImageryProvider
- TileMapServiceImageryProvider
- WebMapServiceImageryProvider
- WebMapTileServiceImageryProvider
- UrlTemplateImageryProvider
- Bing Maps REST Services
- Cross-Origin Resource Sharing
示例: Example:
const bing = await Cesium.BingMapsImageryProvider.fromUrl(
"https://dev.virtualearth.net", {
key: "get-yours-at-https://www.bingmapsportal.com/",
mapStyle: Cesium.BingMapsStyle.AERIAL
});
另见: See:
成员 Members
获取或设置要在制作人员名单中显示的 Bing 徽标的 URL。 Gets or sets the URL to the Bing logo for display in the credit.
readonly credit : Credit
获取此图像提供程序处于活动状态时要显示的信用。通常,这用于证明图像的来源。 Gets the credit to display when this imagery provider is active. Typically this is used to credit the source of the imagery.
请求 Bing 地图图像时使用的区域性。并非所有文化都受支持。参见 The culture to use when requesting Bing Maps imagery. Not all cultures are supported. See http://msdn.microsoft.com/en-us/library/hh441729.aspx
有关受支持文化的信息。 for information on the supported cultures.
readonly errorEvent : Event
获取当图像提供程序遇到异步错误时引发的事件。通过订阅该事件,您将收到错误通知,并有可能从中恢复。事件监听器传递一个实例 Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of
TileProviderError.
获取一个值,该值指示此图像提供程序提供的图像是否包含 Alpha 通道。如果此属性为 false,则 Alpha 通道(如果存在)将被忽略。如果此属性为 true,则任何没有 Alpha 通道的图像都将被视为其 Alpha 在任何地方都是 1.0。将此属性设置为 false 可减少内存使用量和纹理上传时间。 Gets a value indicating whether or not the images provided by this imagery provider include an alpha channel. If this property is false, an alpha channel, if present, will be ignored. If this property is true, any images without an alpha channel will be treated as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage and texture upload time.
获取 Bing 地图密钥。 Gets the Bing Maps key.
获取附加地图图层选项,如中定义 Gets the additional map layer options as defined in https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata#template-parameters/
readonly mapStyle : BingMapsStyle
获取要加载的 Bing 地图图像的类型。 Gets the type of Bing Maps imagery to load.
获取可以请求的最大详细程度。 Gets the maximum level-of-detail that can be requested.
获取可以请求的最低详细程度。 Gets the minimum level-of-detail that can be requested.
readonly proxy : Proxy
获取此提供者使用的代理。 Gets the proxy used by this provider.
readonly rectangle : Rectangle
获取此实例提供的图像的矩形(以弧度为单位)。 Gets the rectangle, in radians, of the imagery provided by this instance.
readonly tileDiscardPolicy : TileDiscardPolicy
获取图块丢弃策略。如果未定义,则丢弃策略负责通过其 shouldDiscardImage 函数过滤掉“丢失”的图块。如果此函数返回未定义,则不会过滤任何图块。 Gets the tile discard policy. If not undefined, the discard policy is responsible for filtering out "missing" tiles via its shouldDiscardImage function. If this function returns undefined, no tiles are filtered.
获取每个图块的高度(以像素为单位)。 Gets the height of each tile, in pixels.
获取每个图块的宽度(以像素为单位)。 Gets the width of each tile, in pixels.
readonly tilingScheme : TilingScheme
获取此提供程序使用的切片方案。 Gets the tiling scheme used by this provider.
获取托管图像的 BingMaps 服务器 URL 的名称。 Gets the name of the BingMaps server url hosting the imagery.
方法 Methods
static Cesium.BingMapsImageryProvider.fromUrl(url, options) → Promise.<BingMapsImageryProvider>
创建一个 Creates an
ImageryProvider 它使用 Bing 地图图像 REST API 提供平铺图像。 which provides tiled imagery using the Bing Maps Imagery REST API.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
url |
Resource | string | 托管图像的 Bing 地图服务器的 URL。 The url of the Bing Maps server hosting the imagery. |
options |
BingMapsImageryProvider.ConstructorOptions | 描述初始化选项的对象 Object describing initialization options |
返回: Returns:
A promise that resolves to the created BingMapsImageryProvider
抛出: Throws:
-
RuntimeError : 元数据未指定资源集中的某一资源 : metadata does not specify one resource in resourceSets
示例: Example:
const bing = await Cesium.BingMapsImageryProvider.fromUrl(
"https://dev.virtualearth.net", {
key: "get-yours-at-https://www.bingmapsportal.com/",
mapStyle: Cesium.BingMapsStyle.AERIAL
});
将用于从 Bing 地图服务器请求图像的图块的四键转换为 (x, y, level) 位置。 Converts a tile's quadkey used to request an image from a Bing Maps server into the (x, y, level) position.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
quadkey |
string | 方块的四键 The tile's quad key |
- Bing Maps Tile System
- BingMapsImageryProvider#tileXYToQuadKey
另见: See:
将图块(x、y、水平)位置转换为用于从 Bing 地图服务器请求图像的四键。 Converts a tiles (x, y, level) position into a quadkey used to request an image from a Bing Maps server.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
x |
number | 图块的 x 坐标。 The tile's x coordinate. |
y |
number | 图块的 y 坐标。 The tile's y coordinate. |
level |
number | 磁贴的缩放级别。 The tile's zoom level. |
- Bing Maps Tile System
- BingMapsImageryProvider#quadKeyToTileXY
另见: See:
getTileCredits(x, y, level) → Array.<Credit>
获取显示给定图块时要显示的积分。 Gets the credits to be displayed when a given tile is displayed.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
x |
number | 平铺 X 坐标。 The tile X coordinate. |
y |
number | 平铺 Y 坐标。 The tile Y coordinate. |
level |
number | 瓷砖水平; The tile level; |
返回: Returns:
显示图块时要显示的制作人员名单。 The credits to be displayed when the tile is displayed.
该图像提供程序当前不支持选取要素,因此该函数仅返回 undefined。 Picking features is not currently supported by this imagery provider, so this function simply returns undefined.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
x |
number | 平铺 X 坐标。 The tile X coordinate. |
y |
number | 平铺 Y 坐标。 The tile Y coordinate. |
level |
number | 瓷砖级别。 The tile level. |
longitude |
number | 选择要素的经度。 The longitude at which to pick features. |
latitude |
number | 选择特征的纬度。 The latitude at which to pick features. |
返回: Returns:
未定义,因为不支持挑选。 Undefined since picking is not supported.
requestImage(x, y, level, request) → Promise.<ImageryTypes>|undefined
请求给定图块的图像。 Requests the image for a given tile.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
x |
number | 平铺 X 坐标。 The tile X coordinate. |
y |
number | 平铺 Y 坐标。 The tile Y coordinate. |
level |
number | 瓷砖级别。 The tile level. |
request |
Request | 可选 optional 请求对象。仅供内部使用。 The request object. Intended for internal use only. |
返回: Returns:
对图像的承诺,该承诺将在图像可用时解析,或者如果对服务器的活动请求太多,则未定义,并且应稍后重试该请求。 A promise for the image that will resolve when the image is available, or undefined if there are too many active requests to the server, and the request should be retried later.
类型定义 Type Definitions
BingMapsImageryProvider 构造函数的初始化选项 Initialization options for the BingMapsImageryProvider constructor
属性: Properties:
| 名称 Name | 类型 Type | Attributes | 默认值 Default | 说明 Description |
|---|---|---|---|---|
key |
string |
<可选> <optional> |
您的应用程序的 Bing 地图密钥,可以在以下位置创建: The Bing Maps key for your application, which can be created at https://www.bingmapsportal.com/. | |
tileProtocol |
string |
<可选> <optional> |
加载图块时使用的协议,例如“http”或“https”。默认情况下,图块使用与页面相同的协议加载。 The protocol to use when loading tiles, e.g. 'http' or 'https'. By default, tiles are loaded using the same protocol as the page. | |
mapStyle |
BingMapsStyle |
<可选> <optional> |
BingMapsStyle.AERIAL | 要加载的 Bing 地图图像的类型。 The type of Bing Maps imagery to load. |
mapLayer |
string |
<可选> <optional> |
其他显示层选项定义于 Additional display layer options as defined on https://learn.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata#template-parameters | |
culture |
string |
<可选> <optional> |
'' | 请求 Bing 地图图像时使用的区域性。并非所有文化都受支持。参见 The culture to use when requesting Bing Maps imagery. Not all cultures are supported. See http://msdn.microsoft.com/en-us/library/hh441729.aspx 有关受支持文化的信息。 for information on the supported cultures. |
ellipsoid |
Ellipsoid |
<可选> <optional> |
Ellipsoid.default | 椭球体。如果未指定,则使用默认椭球体。 The ellipsoid. If not specified, the default ellipsoid is used. |
tileDiscardPolicy |
TileDiscardPolicy |
<可选> <optional> |
确定图块是否无效并应被丢弃的策略。默认情况下,一个 The policy that determines if a tile is invalid and should be discarded. By default, a DiscardEmptyTileImagePolicy
将被使用,期望 Bing 地图服务器将为丢失的图块发送零长度响应。为了确保没有瓷砖被丢弃,构建并传递一个 will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles. To ensure that no tiles are discarded, construct and pass a NeverTileDiscardPolicy 对于这个参数。 for this parameter. |
