English中文

GridImageryProvider

new Cesium.GridImageryProvider(options)

An ImageryProvider 它在每个图块上绘制一个线框网格,具有可控的背景和发光。对于自定义渲染效果或调试地形可能很有用。 that draws a wireframe grid on every tile with controllable background and glow. May be useful for custom rendering effects or debugging terrain.
名称 Name 类型 Type 说明 Description
options GridImageryProvider.ConstructorOptions 描述初始化选项的对象 Object describing initialization options

成员 Members

获取此图像提供程序处于活动状态时要显示的信用。通常,这用于证明图像的来源。 Gets the credit to display when this imagery provider is active. Typically this is used to credit the source of the imagery.
获取当图像提供程序遇到异步错误时引发的事件。通过订阅该事件,您将收到错误通知,并有可能从中恢复。事件监听器传递一个实例 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.

readonly hasAlphaChannel : boolean

获取一个值,该值指示此图像提供程序提供的图像是否包含 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. When this property is false, memory usage and texture upload time are reduced.

readonly maximumLevel : number|undefined

获取可以请求的最大详细程度。 Gets the maximum level-of-detail that can be requested.

readonly minimumLevel : number

获取可以请求的最低详细程度。 Gets the minimum level-of-detail that can be requested.
获取此提供者使用的代理。 Gets the proxy used by this provider.
获取此实例提供的图像的矩形(以弧度为单位)。 Gets the rectangle, in radians, of the imagery provided by this instance.
获取图块丢弃策略。如果未定义,则丢弃策略负责通过其 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.

readonly tileHeight : number

获取每个图块的高度(以像素为单位)。 Gets the height of each tile, in pixels.

readonly tileWidth : number

获取每个图块的宽度(以像素为单位)。 Gets the width of each tile, in pixels.
获取此提供程序使用的切片方案。 Gets the tiling scheme used by this provider.

方法 Methods

将网格渲染到具有背景和发光的画布中 Render a grid into a canvas with background and glow
在画布上绘制网格线。 Draws a grid of lines into a canvas.

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.

pickFeatures(x, y, level, longitude, latitude)undefined

该图像提供程序当前不支持选取要素,因此该函数仅返回 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.<HTMLCanvasElement>

请求给定图块的图像。 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:
解析后的图像为 Canvas DOM 对象。 The resolved image as a Canvas DOM object.

类型定义 Type Definitions

Cesium.GridImageryProvider.ConstructorOptions

GridImageryProvider 构造函数的初始化选项 Initialization options for the GridImageryProvider constructor
属性: Properties:
名称 Name 类型 Type Attributes 默认值 Default 说明 Description
tilingScheme TilingScheme <可选> &lt;optional>
新的地理切片方案() new GeographicTilingScheme() 绘制图块的图块方案。 The tiling scheme for which to draw tiles.
ellipsoid Ellipsoid <可选> &lt;optional>
Ellipsoid.default 椭球体。如果指定了 tilingScheme,则忽略此参数并使用切片方案的椭球体。如果两个参数均未指定,则使用默认椭球体。 The ellipsoid. If the tilingScheme is specified, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the default ellipsoid is used.
cells number <可选> &lt;optional>
8 网格单元的数量。 The number of grids cells.
color Color <可选> &lt;optional>
颜色(1.0、1.0、1.0、0.4) Color(1.0, 1.0, 1.0, 0.4) 绘制网格线的颜色。 The color to draw grid lines.
glowColor Color <可选> &lt;optional>
颜色(0.0、1.0、0.0、0.05) Color(0.0, 1.0, 0.0, 0.05) 为网格线绘制发光的颜色。 The color to draw glow for grid lines.
glowWidth number <可选> &lt;optional>
6 用于渲染线条发光效果的线条宽度。 The width of lines used for rendering the line glow effect.
backgroundColor Color <可选> &lt;optional>
颜色(0.0、0.5、0.0、0.2) Color(0.0, 0.5, 0.0, 0.2) 背景填充颜色。 Background fill color.
tileWidth number <可选> &lt;optional>
256 用于细节级别选择目的的图块宽度。 The width of the tile for level-of-detail selection purposes.
tileHeight number <可选> &lt;optional>
256 用于细节层次选择目的的图块高度。 The height of the tile for level-of-detail selection purposes.
canvasSize number <可选> &lt;optional>
256 用于渲染的画布的大小。 The size of the canvas used for rendering.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.