Change geojson layer style without reloading it

**May I know if it’s possible to dynamically change the style of geojson layer after layer loaded? **

Currently, I need to call GeojsonDataSource.Load(url, { style-options }) to update the style, is there’s a way to update color without reloading?

Thanks!

One way is to iterate over the entities that were created by GeoJsonDataSource.load(). Here’s an example that changes the color of the billboard associated with a point feature after 5 seconds.

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

sceneMode : Cesium.SceneMode.SCENE2D,

timeline : false,

animation : false

});

var myDataSource;

viewer.dataSources.add(Cesium.GeoJsonDataSource.load(’…/…/SampleData/SAR_point.geojson’)).then(function(ds) {

viewer.zoomTo(ds);

myDataSource = ds;

setTimeout(function() {

    var entities = myDataSource.entities.values;

    for (var i = 0; i < entities.length; i++) {

        var entity = entities[i];

        entity.billboard.color = Cesium.Color.RED;

    }

}, 5000);

});

``

Hope that helps.

Scott