Skip to content

KBE3D / KBCore / Cesium / Credit

类: Credit

A credit contains data pertaining to how to display attributions/credits for certain content on the screen.

示例

ts
// 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>');

参数

An string representing an html code snippet

参数

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.

属性

html

readonly html: string

The credit content


showOnScreen

showOnScreen: boolean

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


element

readonly element: HTMLElement

Gets the credit element

方法

equals()

static equals(left?: Credit, right?: Credit): boolean

Returns true if the credits are equal

参数

left?

Credit

The first credit

Credit

The second credit

返回

boolean

true if left and right are equal, false otherwise.


clone()

static clone(credit?: Credit): Credit

Duplicates a Credit instance.

参数

credit?

Credit

The Credit to duplicate.

返回

Credit

A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)


equals()

equals(credit?: Credit): boolean

Returns true if the credits are equal

参数

credit?

Credit

The credit to compare to.

返回

boolean

true if left and right are equal, false otherwise.

构造函数

构造函数

new Credit(html: string, showOnScreen?: boolean): Credit

参数

html

string

showOnScreen?

boolean

返回

Credit

KBE3D @3.0.0 Copyright © 2024-present KBE3D