credit 显示负责在屏幕上显示 credits。
| Name | Type | Default | Description |
|---|---|---|---|
container |
HTMLElement | 将显示 credits 的 HTML 元素 | |
delimiter |
string |
'•'
|
optional 用于分隔文字 credits 的字符串 |
viewport |
HTMLElement |
document.body
|
optional 将包含 credits 弹出框的 HTML 元素 |
Examples:
// Add a credit with a tooltip, image and link to display onscreen
const credit = new Cesium.Credit(`<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>`, true);
viewer.creditDisplay.addStaticCredit(credit);
// Add a credit with a plaintext link to display in the lightbox
const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank">Cesium</a>');
viewer.creditDisplay.addStaticCredit(credit);
Members
static Cesium.CreditDisplay.cesiumCredit : Credit
获取或设置 Cesium 徽标 credit。
将显示 credits 的 HTML 元素.
Methods
添加一个
Credit,它将显示在屏幕上或灯箱中,直到
下一帧。这主要用于内部使用。使用 CreditDisplay.addStaticCredit 可添加一个持久显示在屏幕上的 credit。
| Name | Type | Description |
|---|---|---|
credit |
Credit | 在下一帧中显示的 credit。 |
- CreditDisplay.addStaticCredit
See:
添加一个
Credit,它将显示在屏幕上或灯箱中,直到通过 CreditDisplay.removeStaticCredit 移除。
| Name | Type | Description |
|---|---|---|
credit |
Credit | 要添加的 credit |
Examples:
// Add a credit with a tooltip, image and link to display onscreen
const credit = new Cesium.Credit(`<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>`, true);
viewer.creditDisplay.addStaticCredit(credit);
// Add a credit with a plaintext link to display in the lightbox
const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank">Cesium</a>');
viewer.creditDisplay.addStaticCredit(credit);
将 credit 显示重置为帧开始状态,清除当前的 credits。
销毁此对象持有的资源。销毁对象可以实现资源的确定性
释放,而不是依赖垃圾回收器来销毁此对象。
一旦对象被销毁,就不应再使用它;调用除
一旦对象被销毁,就不应再使用它;调用除
isDestroyed 之外的任何函数都将导致 DeveloperError 异常。因此,
应像示例中那样将返回值(undefined)赋给该对象。
Throws:
-
DeveloperError :此对象已被销毁,即已调用 destroy()。
将 credit 显示设置为帧结束状态,在 credit 容器中显示上一帧的 credits。
如果此对象已销毁则返回 true,否则返回 false。
Returns:
true 如果此对象已销毁,false 否则。
移除在屏幕上或灯箱中显示的静态 credit。
| Name | Type | Description |
|---|---|---|
credit |
Credit | 要移除的 credit。 |
在渲染新帧之前更新 credit 显示。
