# Polygon Collection?

**URL:** <https://community.cesium.com/t/polygon-collection/239>\
**Category:** CesiumJS\
**Created:** [January 23, 2013, 2:07pm UTC](https://community.cesium.com/t/polygon-collection/239 "2013-01-23T14:07:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Lounsbury](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jon\_Lounsbury](https://community.cesium.com/u/Jon_Lounsbury)\
**Post date:** [January 23, 2013, 2:07pm UTC](https://community.cesium.com/t/polygon-collection/239/1 "2013-01-23T14:07:44Z")

</div>

Currently, I have some code working that allows a user to click on a polygon on the globe to select the polygon, then perform a number of different functions to it. These functions use the polygon's ID to send calls to various web services.

Now, I'm trying to extend this functionality to operate on groups/collections of polygons. For example, say we have polygon groups A, B, and C, with associated polygons a1 and a2; b1; and c1, c2, and c3. When the user clicks on c2, I'd like to automatically select c1 and c3 as well, and have a unique ID for polgyon group C, not polygon c2, to send back to the web services. Is anything like this possible natively in Cesium? If not, I was thinking I could implement a function to automatically search for "sister" polygons when the user selects a polygon based on a naming convention.

Jon

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [January 23, 2013, 2:18pm UTC](https://community.cesium.com/t/polygon-collection/239/2 "2013-01-23T14:18:24Z")

</div>

Jon,

Add all your sister polygons to an array, and give each polygon a  
reference to this array, e.g., polygon.sisterPolygons = ...

When you do a pick, you can use the array to operate on all the sister polygons.

Regards,  
Patrick

---

<div class="post-metadata">

**Author:** ![Jon\_Lounsbury](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jon\_Lounsbury](https://community.cesium.com/u/Jon_Lounsbury)\
**Post date:** [January 23, 2013, 5:11pm UTC](https://community.cesium.com/t/polygon-collection/239/3 "2013-01-23T17:11:25Z")

</div>

Perfect! Thanks!

Jon
