Hi,there
I am new to Cesium, and this problem has been confusing me recently.The following is the specific problem.
1. A concise explanation of the problem you're experiencing.
When I load geojson(line) to viewer with "ClampToGround: true" via GeoJsonDataSource,then I obtain the geojson's entities,and I want to set the properties of entities like material, width and so on, then the problem occured,the settings didn't work.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
var Promise = Cesium.GeoJsonDataSource.load('Data/road1.geojson',{
//strokeWidth: 2000,
clampToGround: true//but when I change "true" to "false",the code didn't work could work
});
Promise.then(function(dataSource) {
viewer.dataSources.add(dataSource);
var entities = dataSource.entities.values;
for(var i=0;i<entities.length;i++){
var entity = entities[i];
entity.polyline.width=5;//didn't work
entity.polyline.material = Cesium.Color.GREEN;//didn't work
entity.polyline.distanceDisplayCondition = 500000.0//didn't work
}
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
My study area is a large area of mountain, I add the geojson(line) to show the boundary of my study area.When I set the value of geojson's clampToGeojson to true,the width of line will looks like gets thicker and thicker as the distance gets closer.So I want to display different entity while the distance to camera changed.But the settings about entity like width and distanceDisplayCondition didn't work,and I was aware of that due to set the clampToGround to true after many attempts.How can I resolve the conflit between clamp to ground and the setting the properties(width and distanceDisplayCondition) of entity.polyline?
4. The Cesium version you're using, your operating system and browser.
Cesium version:1.45
Operating system:windows 10
browser:Chrome and Edge
Any reply would be appreciated.