# Change geojson layer style without reloading it

**URL:** <https://community.cesium.com/t/change-geojson-layer-style-without-reloading-it/7393>\
**Category:** CesiumJS\
**Created:** [September 5, 2018, 9:53pm UTC](https://community.cesium.com/t/change-geojson-layer-style-without-reloading-it/7393 "2018-09-05T21:53:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Arthur](https://community.cesium.com/u/Arthur)\
**Post date:** [September 5, 2018, 9:53pm UTC](https://community.cesium.com/t/change-geojson-layer-style-without-reloading-it/7393/1 "2018-09-05T21:53:32Z")

</div>

\*\*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!**

---

<div class="post-metadata">

**Author:** ![Scott\_Reynolds](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/scott_reynolds/32/2014_2.png) [@Scott\_Reynolds](https://community.cesium.com/u/Scott_Reynolds)\
**Post date:** [September 6, 2018, 11:19am UTC](https://community.cesium.com/t/change-geojson-layer-style-without-reloading-it/7393/2 "2018-09-06T11:19:52Z")

</div>

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
