# Moving the rectangle, using mouse

**URL:** <https://community.cesium.com/t/moving-the-rectangle-using-mouse/14699>\
**Category:** CesiumJS\
**Created:** [August 4, 2021, 3:32am UTC](https://community.cesium.com/t/moving-the-rectangle-using-mouse/14699 "2021-08-04T03:32:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ammar\_Khalil](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ammar_khalil/32/5703_2.png) [@Ammar\_Khalil](https://community.cesium.com/u/Ammar_Khalil)\
**Post date:** [August 4, 2021, 3:32am UTC](https://community.cesium.com/t/moving-the-rectangle-using-mouse/14699/1 "2021-08-04T03:32:25Z")

</div>

I already have geometries drawn on map , including lines, polygon, circle, rectangle etc, i was able to move circle using mouse drag as i only needed to move the center of the circle to the new mouse position, however i am struggling with moving rectangle, polygon and line etc, as it has multiple points to be moved, i have the basic idea that i need to use callback, and for the case of rectangle i have to change its west, south, east, north but i am unable to grab entire idea about how to do it based on mouse move what position will be set to the west, south, east and north and whether it will be addition or subtraction because mouse can move in any direction. Any help will be much appreciated.

---

<div class="post-metadata">

**Author:** ![Ammar\_Khalil](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ammar_khalil/32/5703_2.png) [@Ammar\_Khalil](https://community.cesium.com/u/Ammar_Khalil)\
**Post date:** [August 10, 2021, 3:14am UTC](https://community.cesium.com/t/moving-the-rectangle-using-mouse/14699/2 "2021-08-10T03:14:00Z")

</div>

@sam.rothstein

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [August 10, 2021, 6:33pm UTC](https://community.cesium.com/t/moving-the-rectangle-using-mouse/14699/3 "2021-08-10T18:33:45Z")

</div>

@Ammar_Khalil

Can you please send me a sandcastle demo of what you have so far? It sounds like you are on the right track, but it would be helpful for me to see some of your code. I am not sure if any other users have implemented this functionality. _ **Does the rest of the community have any feedback?** _

-Sam

---

<div class="post-metadata">

**Author:** ![nurikserikbay1995](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/nurikserikbay1995/32/25517_2.png) [@nurikserikbay1995](https://community.cesium.com/u/nurikserikbay1995)\
**Post date:** [September 5, 2024, 12:32pm UTC](https://community.cesium.com/t/moving-the-rectangle-using-mouse/14699/4 "2024-09-05T12:32:23Z")

</div>

hello. can you find a solution?

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [September 9, 2024, 7:33pm UTC](https://community.cesium.com/t/moving-the-rectangle-using-mouse/14699/5 "2024-09-09T19:33:40Z")

</div>

Hi,

Can you provide some more details about the use case?

While it is possible to use callback properties for every entity, if you have many dynamic entities in a scene you will likely see a performance impact.

[This sandcastle example](https://sandcastle.cesium.com/?src=Drawing%20on%20Terrain.html&label=All) is probably a good place to start.
