# Changing the color by attribute in geojson format objects

**URL:** <https://community.cesium.com/t/changing-the-color-by-attribute-in-geojson-format-objects/30603>\
**Category:** CesiumJS\
**Created:** [March 16, 2024, 6:10pm UTC](https://community.cesium.com/t/changing-the-color-by-attribute-in-geojson-format-objects/30603 "2024-03-16T18:10:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugenethepooh](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/eugenethepooh/32/14000_2.png) [@eugenethepooh](https://community.cesium.com/u/eugenethepooh)\
**Post date:** [March 16, 2024, 6:10pm UTC](https://community.cesium.com/t/changing-the-color-by-attribute-in-geojson-format-objects/30603/1 "2024-03-16T18:10:25Z")

</div>

Hi!  
I have a layer with houses. I want to set a specific color based on the house number. But I don’t understand how to do it. I didn’t quite understand the example on the sandcastle. can you tell me how my code will change?

```auto
async function addGeoJSON() {
  const geoJSONURL = await Cesium.IonResource.fromAssetId(2484167);
  const geoJSON = await Cesium.GeoJsonDataSource.load(geoJSONURL, { clampToGround: true });
  const dataSource = await viewer.dataSources.add(geoJSON);
  for (const entity of dataSource.entities.values) {
    entity.polygon.classificationType = Cesium.ClassificationType.TERRAIN;
    entity.polygon.height = 3;
    entity.polygon.extrudedHeight = 6;
  };
  viewer.zoomTo(dataSource);
};
addGeoJSON();

```

Best,  
Eugenia
