Class: ImageMaterialProperty

ImageMaterialProperty

new ImageMaterialProperty(options)

A MaterialProperty that maps image resources to the uniforms variable of Material.

Name Type Description
options Object optional

Object is an object that contains the following properties:

Name Type Default Description
image Property optional

Specify the image URL、 Properties of canvas or video.

repeat Property new Cartesian2(1.0, 1.0) optional

Cartesian2 attribute specifies the number of repetitions of the image in each direction.

color Property Color.WHITE optional

Apply colors to images.

transparent Property false optional

When the image has transparency (for example, when PNG has transparent parts), set it to true.

colorTable ColorTable optional

Color chart for layering based on height

Members

colorProperty

Get or set color properties to specify the desired color to apply to the image.

Default Value:
1.0

readonly definitionChangedEvent

Get the event thrown when the property definition changes. If calling getValue returns different results within the same time frame, it is considered that the definition has changed.

imageProperty

Get or set properties to specify the image resource to be used, such as Image, URL, Canvas, or Video.

readonly isConstantBoolean

Get a value indicating whether the attribute is a constant. If getValue always returns the same result in the current definition, then the property is considered a constant.

repeatProperty

Get or set Cartesian2, specifying the number of repetitions of the image in each direction.

Default Value:
new Cartesian2(1, 1)

transparentProperty

Get or set Boolean properties to specify whether the image has transparency.

Default Value:
1.0

Methods

static fromJSON(json){ImageMaterialProperty}

从 JSON 对象反序列化为 ImageMaterialProperty 实例

Name Type Description
json object

The serialized JSON object

Returns:
Type Description
ImageMaterialProperty 新的 ImageMaterialProperty 实例

equals(other){Boolean}

Compare this attribute with the provided attribute, return true if they are equal, otherwise return false.

Name Type Description
other Property optional

A property.

Returns:
Type Description
Boolean If left and right are equal, it is true; otherwise, it is false.

getType(time){String}

Retrieve the Material type for the specified time.

Name Type Description
time JulianDate

Value taking time.

Returns:
Type Description
String The type of material.

getValue(time, result){Object}

Retrieve the attribute value of the attribute at the specified time.

Name Type Description
time JulianDate

The time to retrieve the attribute value.

result Object optional

If the object to store numerical values is omitted, a new instance will be created and returned.

Returns:
Type Description
Object The modified result parameters, or a new instance (if no result parameters are provided).

toJSON(){object}

序列化 ImageMaterialProperty 实例为 JSON 对象

Returns:
Type Description
object JSON serialized object containing core configuration