材质模块
Parameters:
Name | Type | Description |
---|---|---|
viewer |
object
|
cesium 实例 |
cesiumGlobal |
object
|
cesium 全局对象 |
defaultStatic |
Array
|
静态资源 |
Extends
Methods
# addMaterialLineGraphics(options) → {polyline}
添加动态炫光线材质
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
image |
string
|
图片url |
positions |
Cartesian3
|
坐标 |
color |
Color
|
颜色 |
duration |
number
|
持续时长 |
width |
number
|
宽度 |
返回polyline实例
polyline
Example
import { Material } from 'cesium_dev_kit'
const {material,viewer} = new Material({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
})
material.addMaterialLineGraphics({
positions:Cesium.Cartesian3.fromDegrees(104.081701757991, 30.627042558105988, 400.0)
color:Cesium.Color.GREEN,
image:'static/data/images/Textures/billboard2.png',
duration:500,
width:2
})
# addMaterialWallGraphics() → {wall}
添加 动态围栏/炫光墙体
Parameters:
Name | Type | Description |
---|---|---|
options.image |
string
|
图片url |
options.duration |
number
|
持续时长 |
options.color |
Color
|
颜色 |
options.width |
number
|
宽度 |
返回wall实例
wall
Example
import { Material } from 'cesium_dev_kit'
const {material,viewer} = new Material({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
})
// 创建炫光墙体
material.addMaterialWallGraphics({
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
104.07263175401185,
30.647622150198725,
500.0,
104.06369117158526,
30.648834374000277,
500.0,
104.06437182811021,
30.62274533905387,
500.0,
104.07463538167119,
30.62285687644371,
500.0,
104.07263175401185,
30.647622150198725,
500.0
]),
width:1200,
image: 'static/data/images/Textures/test1.png',,
color: Cesium.Color.BLUE,,
duration: 2000
});
# getCustomMaterialLine(options) → {PolylineCustomMaterialProperty}
获取一个动态线材质
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
image |
string
|
图片url |
duration |
number
|
持续时长 |
color |
Color
|
颜色 |
time |
JulianDate
|
Julian时间 |
PolylineCustomMaterialProperty
Example
import { initCesium } from 'cesium_dev_kit'
const {viewer,graphics,material} = new initCesium({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
})
const materialCust = material.getCustomMaterialLine({
color:Cesium.Color.GREEN,
image:'static/data/images/Textures/billboard2.png',
duration:1005,
time:Cesium.JulianDate.fromIso8601("2024-05-19 15:36"),
})
graphics.getLineGraphics({
positions:Cesium.Cartesian3.fromDegreesArray([
104.09816110606057,
30.659821965447698,
104.1120972824757,
30.65330300319938,
104.10758419863926,
30.64592470850288,
104.09351691196979,
30.652434826507452,
104.09816110606057,
30.659821965447698
]),
material:materialCust,
clampToGround:false,
width:1
})
# getCustomMaterialWall(options) → {WallLinkCustomMaterialProperty}
获取一个材质围栏
Parameters:
Name | Type | Description |
---|---|---|
options |
object
|
|
image |
string
|
图片url |
duration |
number
|
持续时长 |
color |
Color
|
颜色 |
count |
number
|
频率 |
freely |
string
|
方向,可选["vertical"|"cross"] |
direction |
string
|
方向,可选["-"|"+"] |
WallLinkCustomMaterialProperty
Example
import { initCesium } from 'cesium_dev_kit'
const {material,graphics,viewer} = new initCesium({
cesiumGlobal: Cesium,
containerId: 'cesiumContainer'
})
// 创建动态材质
const custMaterial = material.getCustomMaterialWall({
image: 'static/data/images/Textures/test1.png',,
freely: 'cross',
direction: '+',
count: 0.0,,
color: Cesium.Color.BLUE,,
duration: 2000
});
// 创建扇形扫描
graphics.createFanShape({
viewer,
longitude: 104.06417395476578,
latitude: 30.636185094244944,
alt: 700,
speed: 2.0,
direction: '+',
custMaterial
})