# rectangle hit location

**URL:** <https://community.cesium.com/t/rectangle-hit-location/4205>\
**Category:** CesiumJS\
**Created:** [June 7, 2016, 8:56am UTC](https://community.cesium.com/t/rectangle-hit-location/4205 "2016-06-07T08:56:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfirbene](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@kfirbene](https://community.cesium.com/u/kfirbene)\
**Post date:** [June 7, 2016, 8:56am UTC](https://community.cesium.com/t/rectangle-hit-location/4205/1 "2016-06-07T08:56:19Z")

</div>

Hi,

I have a Cesium entity that from it I am creating and constantly updating polyline to several directions.

I need to place billboards on the edges of the map view in case that the entity is within the: scene\*\*.camera.\*\ ***computeViewRectangle** on the polyline.

How can I get the location where the polyline hits the view rectangle?

Thanks,

Kfir.

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [June 7, 2016, 2:33pm UTC](https://community.cesium.com/t/rectangle-hit-location/4205/2 "2016-06-07T14:33:28Z")

</div>

Hello Kfir,

There is no function like this built into Cesium. You will have to do your own calculation.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![kfirbene](https://avatars.discourse-cdn.com/v4/letter/k/ba8739/32.png) [@kfirbene](https://community.cesium.com/u/kfirbene)\
**Post date:** [June 7, 2016, 4:46pm UTC](https://community.cesium.com/t/rectangle-hit-location/4205/3 "2016-06-07T16:46:36Z")

</div>

Hannah,  
Is there an api for verifing that the entity is in the camera view/ rectangle?

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [June 7, 2016, 5:12pm UTC](https://community.cesium.com/t/rectangle-hit-location/4205/4 "2016-06-07T17:12:18Z")

</div>

Not directly, but you can use [Rectangle.contains](http://cesiumjs.org/Cesium/Build/Documentation/Rectangle.html#.contains) to determine whether the position is in the rectangle.

-Hannah
