English中文

DiscardMissingTileImagePolicy

new Cesium.DiscardMissingTileImagePolicy(options)

丢弃与包含“缺失”图像的已知图像相匹配的图块图像的策略。 A policy for discarding tile images that match a known image containing a "missing" image.
名称 Name 类型 Type 说明 Description
options object 具有以下属性的对象: Object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
missingImageUrl Resource | string 已知缺失图像的 URL。 The URL of the known missing image.
pixelsToCheck Array.<Cartesian2> 一个数组 An array of Cartesian2 与丢失图像进行比较的像素位置。 pixel positions to compare against the missing image.
disableCheckIfAllPixelsAreTransparent boolean false 可选 optional 如果为 true,则如果missingImageUrl 中的所有pixelsToCheck 的alpha 值为0,则丢弃检查将被禁用。如果为false,则无论pixelsToCheck 的值如何,丢弃检查都将继续。 If true, the discard check will be disabled if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the discard check will proceed no matter the values of the pixelsToCheck.

方法 Methods

确定丢弃策略是否准备好处理图像。 Determines if the discard policy is ready to process images.
返回: Returns:
如果丢弃策略已准备好处理图像,则为 True;否则为假。 True if the discard policy is ready to process images; otherwise, false.

shouldDiscardImage(image)boolean

给定一个平铺图像,决定是否丢弃该图像。 Given a tile image, decide whether to discard that image.
名称 Name 类型 Type 说明 Description
image HTMLImageElement 要测试的图像。 An image to test.
返回: Returns:
如果图像应该被丢弃,则为 True;否则为假。 True if the image should be discarded; otherwise, false.
抛出: Throws:
  • DeveloperError : shouldDiscardImage 在丢弃策略准备好之前不得调用。 must not be called before the discard policy is ready.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.