# customDataSource

**URL:** <https://community.cesium.com/t/customdatasource/3351>\
**Category:** CesiumJS\
**Created:** [November 20, 2015, 5:03pm UTC](https://community.cesium.com/t/customdatasource/3351 "2015-11-20T17:03:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![retepik](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@retepik](https://community.cesium.com/u/retepik)\
**Post date:** [November 20, 2015, 5:03pm UTC](https://community.cesium.com/t/customdatasource/3351/1 "2015-11-20T17:03:49Z")

</div>

Hi everyone,  
I have got customDataSource with few enetities,  
Is there any way how change position one of them?  
Thanks  
Best Regards  
retepik

---

<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:** [November 20, 2015, 6:33pm UTC](https://community.cesium.com/t/customdatasource/3351/2 "2015-11-20T18:33:50Z")

</div>

Hello Retepik,

You can change the position of any of the entities by simply setting the position to a new value.

ie entity.position = Cesium.Cartesian3.fromDegrees(newLongitude, newLatitude);

Have you seen this tutorial on visualizing spatial data? [http://cesiumjs.org/2015/02/02/Visualizing-Spatial-Data/](http://cesiumjs.org/2015/02/02/Visualizing-Spatial-Data/)

There’s a lot of information on how to use the entity API in that tutorial.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![retepik](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@retepik](https://community.cesium.com/u/retepik)\
**Post date:** [November 20, 2015, 7:17pm UTC](https://community.cesium.com/t/customdatasource/3351/3 "2015-11-20T19:17:44Z")

</div>

Thanks Hannah,  
I understand how change position of entiy.  
But I don't know how can I get a entity from my custom data source?  
For example I have got one customDataSource and name of specify entity and I want change position or visibility of entity.  
Thanks

---

<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:** [November 23, 2015, 8:34pm UTC](https://community.cesium.com/t/customdatasource/3351/4 "2015-11-23T20:34:30Z")

</div>

Sorry for misunderstanding your question.

You can do [CustomDataSource.entities](http://cesiumjs.org/Cesium/Build/Documentation/CustomDataSource.html#entities) to get the [EntityCollection](http://cesiumjs.org/Cesium/Build/Documentation/EntityCollection.html). You can use customDataSource.entities.getById(‘my entity id’) to get the entity with that id.

Does that answer your question? If not, could you paste a code sample of how you are adding entities to the custom datasource? That’ll help me better understand what you’re trying to accomplish.

Thanks,

Hannah
