# how to use a water material in my polygon?

**URL:** <https://community.cesium.com/t/how-to-use-a-water-material-in-my-polygon/2174>\
**Category:** CesiumJS\
**Created:** [March 17, 2015, 7:33am UTC](https://community.cesium.com/t/how-to-use-a-water-material-in-my-polygon/2174 "2015-03-17T07:33:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Wang](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/chris_wang/32/4450_2.png) [@Chris\_Wang](https://community.cesium.com/u/Chris_Wang)\
**Post date:** [March 17, 2015, 7:33am UTC](https://community.cesium.com/t/how-to-use-a-water-material-in-my-polygon/2174/1 "2015-03-17T07:33:30Z")

</div>

I made a polygon for a river and want to add the water material as in Sandcastle.  
i want to know what i need and how to write the code.

---

<div class="post-metadata">

**Author:** ![Chris\_Wang](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/chris_wang/32/4450_2.png) [@Chris\_Wang](https://community.cesium.com/u/Chris_Wang)\
**Post date:** [March 18, 2015, 3:02am UTC](https://community.cesium.com/t/how-to-use-a-water-material-in-my-polygon/2174/2 "2015-03-18T03:02:04Z")

</div>

在 2015年3月17日星期二 UTC+8下午3:33:30，ecnuz...@gmail.com写道：

> I made a polygon for a river and want to add the water material as in Sandcastle.  
> i want to know what i need and how to write the code.

Can anyone help me?

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [March 18, 2015, 3:04am UTC](https://community.cesium.com/t/how-to-use-a-water-material-in-my-polygon/2174/3 "2015-03-18T03:04:44Z")

</div>

Are you using an Entity polygon, or PolygonGeometry? There’s an example of doing this with PolygonGeometry here: [http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Materials.html&label=Showcases](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Materials.html&label=Showcases) (Choose Misc Materials -\> Water).

Doing it with an Entity right now is harder than it should be, but I’m hoping to fix that in the near future. If that’s what you’re doing, I’ll see if I can throw together some sample code for you. (I actually started to do this earlier today, but got distracted).

---

<div class="post-metadata">

**Author:** ![Chris\_Wang](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/chris_wang/32/4450_2.png) [@Chris\_Wang](https://community.cesium.com/u/Chris_Wang)\
**Post date:** [March 18, 2015, 7:37am UTC](https://community.cesium.com/t/how-to-use-a-water-material-in-my-polygon/2174/4 "2015-03-18T07:37:35Z")

</div>

在 2015年3月18日星期三 UTC+8上午11:04:45，Matthew Amato写道：

> Are you using an Entity polygon, or PolygonGeometry? There's an example of doing this with PolygonGeometry here: [http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Materials.html&label=Showcases](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Materials.html&label=Showcases) (Choose Misc Materials -\> Water).
> 
> Doing it with an Entity right now is harder than it should be, but I'm hoping to fix that in the near future. If that's what you're doing, I'll see if I can throw together some sample code for you. (I actually started to do this earlier today, but got distracted).
> 
> 在 2015年3月17日星期二 UTC+8下午3:33:30，ecnuz...@gmail.com写道：
> 
> \> I made a polygon for a river and want to add the water material as in Sandcastle.
> 
> \> i want to know what i need and how to write the code.
> 
> Can anyone help me?
> 
> --
> 
> You received this message because you are subscribed to the Google Groups "cesium-dev" group.
> 
> To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

Thanks for your reply. I think I am using a entity polygon (a polygon from a geojson datasource ). if so, that's the harder one you mentioned. it's ok if there is no solution. I can just replace the material with a simple color. Hope you find the way to do it.
