cesium版本1.104
加载geojson面
加载面并增加面的轮廓
Cesium.GeoJsonDataSource.load("xxx.json").then(dataSource=> {
let entities = dataSource.entities.values;
for (let i = 0; i < entities.length; i++) {
let entity = entities[i];
let positions = entity.polygon.hierarchy._value.positions;
entity.polyline = new Cesium.PolylineGraphics({
positions: positions,
clampToGround: true,
width: 10,
material: Cesium.Color.fromCssColorString('#ff1111ff')
});
viewer.entities.add(entity)
}
});
加载线
Cesium.GeoJsonDataSource.load("xxx.json").then(dataSource=> {
let entities = dataSource.entities.values;
for (let i = 0; i < entities.length; i++) {
let entity = entities[i];
entity.polyline.clampToGround: true,
entity.polyline.width: 10,
entity.polyline.material: Cesium.Color.fromCssColorString('#ff1111ff')
viewer.entities.add(entity)
}
});