基于Cesium的材质线插件,引入即可使用,需要的自取。
插件地址:传送门
在线访问: 查看地址
使用
// 自定义纹理材质
let MaterialLineImage = [
'./src/line.png',
'./src/line2.png',
'./src/line3.png',
]
// color
let colors = [
new Cesium.Color(77 / 255, 201 / 255, 255 / 255, 1),
new Cesium.Color(255 / 255, 201 / 255, 38 / 255, 1),
new Cesium.Color(221 / 255, 221 / 255, 221 / 255, 1)
];
// 创建材质线
let getCustomMaterialLine = (image, color) => {
return new Cesium.CustomMaterialLine({
image: image,
color: color,
duration: 2000
})
}
// 添加实体线
let startPoint = Cesium.Cartesian3.fromDegrees(104.081701757991, 30.62704