# Passing styling information in GeoJSON

**URL:** <https://community.cesium.com/t/passing-styling-information-in-geojson/22476>\
**Category:** CesiumJS\
**Created:** [February 22, 2023, 1:44am UTC](https://community.cesium.com/t/passing-styling-information-in-geojson/22476 "2023-02-22T01:44:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sakna.hewagalamulage](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sakna.hewagalamulage/32/3476_2.png) [@sakna.hewagalamulage](https://community.cesium.com/u/sakna.hewagalamulage)\
**Post date:** [February 22, 2023, 1:44am UTC](https://community.cesium.com/t/passing-styling-information-in-geojson/22476/1 "2023-02-22T01:44:20Z")

</div>

Hi,

Data to display on the map is loaded using a GeoJSON and it contains a range of Points, MultiLineStrings and Polygons.

I would like to know is it possible to pass on styling information in the GeoJSON like how CZML does.

Currently I am doing the following to style it:

````auto
const entities = dataSource.entities.values;
      for (let i = 0; i < entities.length; i++) {
        const entity = entities[i];

        //Set the polygon material to our random color.
        if (entity.properties.entity._value !== null &&
          entity.properties.entity._value.toLowerCase().includes('line')) {
          entity.polyline.material = new Cesium.PolylineDashMaterialProperty({
            color: Cesium.Color.DARKGREEN,
            dashLength: 8.0,
          });
          entity.polyline.width = 3;
          entity.polyline.clampToGround = true;
        }
      }```

If it is possible to pass on the style in GeoJSON it would make it easier.

Any help is highly appreciated.

Thanks
````

---

<div class="post-metadata">

**Author:** ![Alexander\_Johannesen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/alexander_johannesen/32/2008_2.png) [@Alexander\_Johannesen](https://community.cesium.com/u/Alexander_Johannesen)\
**Post date:** [February 22, 2023, 3:05am UTC](https://community.cesium.com/t/passing-styling-information-in-geojson/22476/2 "2023-02-22T03:05:21Z")

</div>

If you mean through the GeoJSON file itself, styling is quite limited, however Cesium supports SimpleStyle (originally from MapBox). Look at this Sandcastle for demo and more info in the comments;

> **[Cesium Sandcastle](https://sandcastle.cesium.com/index.html?src=GeoJSON%2520simplestyle.html)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Cheers,

Alex
