Credit

new Cesium.Credit(html, showOnScreen)

A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
参数名称 类型 默认值 描述信息
html string An string representing an html code snippet
showOnScreen boolean false 可选 If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover. All credits are displayed `inline`, if you have an image we recommend sizing it correctly to match the text or use css to `vertical-align` it.
Throws:
使用示例:
// Create a credit with a tooltip, image and link
const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png"  style="vertical-align: -7px" title="Cesium"/></a>');

成员(属性)

readonly element : HTMLElement

Gets the credit element

readonly html : string

The credit content

showOnScreen : boolean

Whether the credit should be displayed on screen or in a lightbox

方法

static Cesium.Credit.clone(credit)Credit

Duplicates a Credit instance.
参数名称 类型 描述信息
credit Credit 可选 The Credit to duplicate.
返回值:
A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)

static Cesium.Credit.equals(left, right)boolean

Returns true if the credits are equal
参数名称 类型 描述信息
left Credit The first credit
right Credit The second credit
返回值:
true if left and right are equal, false otherwise.

equals(credit)boolean

Returns true if the credits are equal
参数名称 类型 描述信息
credit Credit The credit to compare to.
返回值:
true if left and right are equal, false otherwise.