The conflit between clamping Geojson(line) to ground and setting the property of polyline?

  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) {
        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.

This is because previously Cesium did not support polylines on terrain, as it brings up some complicated issues to solve. When loading a GeoJSON and clamping to terrain, we use a workaround by representing them with corridors.

The good news is that polylines on terrain will be part of the next Cesium release!



Hi Gabby
  Thanks a lot for your reply.
  I'm glad to hear the good news,I can't wait to see the new release,and want to know when the next Cesium release will release?
  The example you show for me using Cesium.Cartesian3.fromDegreesArray to define the position of corridors, and I want to know how could I connect GeoJson to corridors.Hope to get your answer.

The next release is July 2.

GeoJson uses the corridors as a workaround, so in the meantime, set properties on the corridor entities instead of the polyline ones.

Thanks for your reply.