Cesium.GeoJsonDataSource.load(e)
.then((dataSource:any) => {
dataSource.entities.values.forEach((entity:any) => {
if (entity.polygon) { // 面
entity.polygon.material = new Cesium.CheckerboardMaterialProperty({
evenColor : Cesium.Color.WHITE,//白底更换
oddColor : Cesium.Color.BLACK,//黑底更换
repeat : new Cesium.Cartesian2(4, 4)//棋盘
});
//斑马纹
// '/public/app1.jpg'//底图的材质
}
});
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);
})
.catch(() => {
});
在material 方面替换不同的属性
轮廓
ellipse.fill = false;
ellipse.outline = true;
ellipse.outlineColor = Cesium.Color.YELLOW;
ellipse.outlineWidth = 2.0;
条纹
ellipse.material = new Cesium.StripeMaterialProperty({
evenColor : Cesium.Color.WHITE,
oddColor : Cesium.Color.BLACK,
repeat : 32
});
网格:
ellipse.material = new Cesium.GridMaterialProperty({
color : Cesium.Color.YELLOW,
cellAlpha : 0.2,
lineCount : new Cesium.Cartesian2(8, 8),
lineThickness : new Cesium.Cartesian2(2.0, 2.0)
});
306

被折叠的 条评论
为什么被折叠?



