点entity文章来源:https://www.toymoban.com/news/detail-641995.html
function f2(){
var x=1;var flog=true;//闪烁
//var x=0;var flog=false;//渐显
viewer.entities.add({
name:"圆点point闪烁",
position:Cesium.Cartesian3.fromDegrees(116.20+0.03,39.53+0.03,0),
point : {
show : true, // default
color :new Cesium.CallbackProperty(function () {
if(flog){
x=x-0.05;
if(x<=0){
flog=false;
}
}else{
x=x+0.05;
if(x>=1){
flog=true;
}
}
return Cesium.Color.RED.withAlpha(x);
},false),
pixelSize : 10, // default: 1
outlineWidth :0
}
});
}
面entity 文章来源地址https://www.toymoban.com/news/detail-641995.html
function f1() {
var x = 1;
var flog = true;
viewer.entities.add({
name: "圆形区域闪烁",
position: Cesium.Cartesian3.fromDegrees(116.20, 39.53, 0),
ellipse: {
semiMinorAxis: 2000.0,
semiMajorAxis: 2000.0,
height: 0,
material: new Cesium.ColorMaterialProperty(new Cesium.CallbackProperty(function () {
if (flog) {
x = x - 0.05;
if (x <= 0) {
flog = false;
}
} else {
x = x + 0.05;
if (x >= 1) {
flog = true;
}
}
console.log(x)
return Cesium.Color.RED.withAlpha(x);
}, false))
}
});
}
到了这里,关于Cesium entity 渐隐渐显、闪烁的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!