# Bug in removing a dataSource from the Viewer?

**URL:** <https://community.cesium.com/t/bug-in-removing-a-datasource-from-the-viewer/9653>\
**Category:** CesiumJS\
**Created:** [May 18, 2020, 1:22pm UTC](https://community.cesium.com/t/bug-in-removing-a-datasource-from-the-viewer/9653 "2020-05-18T13:22:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mholthausen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mholthausen/32/2615_2.png) [@mholthausen](https://community.cesium.com/u/mholthausen)\
**Post date:** [May 18, 2020, 1:22pm UTC](https://community.cesium.com/t/bug-in-removing-a-datasource-from-the-viewer/9653/1 "2020-05-18T13:22:38Z")

</div>

Based on this [modified sandcastle](https://sandcastle.cesium.com/#c=dVR/a9swEP0qR/ZHHUjklBa2dkm3NelGR9dBnQ0GhqJal1itLAVJTpqNffedLKc/PUOwdbp7evf0LmtuYS1xgxYmoHEDU3SyrtjPJpbkvaJZT432XGq0ea//Pte5TtOze16tFML+MVwYLmAjfQkCF7xWHpzfKqmXLNcZ16LgzitkXIhZ3J8bo264Pa29N5oOmT0vy3sDWNS68NJoSPrwJ9fQsmSCe56Z2hKvAJiELdix/oLmqzN69pDDFFFrcwDyHmNp1tAOKanG6/1RdV27a+e5J0BvVuaWAPJeLOmHV2z4765vmNsteAMWK7NG8CXCIydiybuYxuQkhFwT6jdQGSKU3q/ccZpGoVlhqlSYwrXrWze0uBhSJH3samqUwkYdVvpKfSgUd+6zVB7tJGa9iQe+lP+l7lcxq1NuMoZwZIqObpboT7eXvMJk778S7gW9AAqjnVHhHpaJcDEWoCM/0Y2/U8u9xmjrwsbDjVyhQ99chCtQI2xK1ODIj0VJZiJPVsY9d6JtKiavu07TrIUqqD3Lw0Vz+JEBAZO6RNgHmUXDGgiwPQdueHEXkoldOFNq2BirBHE3VkjdSPPExRGdOjJ3n/xzD0+5pWTJ9QFbWFPNcGkRXTI8esdGAzgcsVF/EAuejOtjUTIKacPDt0cjesL3wdFB/HxwczeNueXaLYytkhb0G/dW3h+y89nZ5fx8/qsRnX69QW8cJhVPdoP1UVYrYz3UViU0Yh5pxELL6U1d3KFnhWuvEmCcPi0dC7kGKSYd/zPQuJp2FrVSmfxNNj0Zp5T/qjTMOIn+fY1W8W1IK/dPLmKQMTZOadld6eM8vED+Bw), it does not seem possible to remove a `dataSource` from the viewer (in my case and in the case of the example it is a `GeoJsonDataSource`).  
According to the API, the [function `remove(dataSource)`](https://cesium.com/docs/cesiumjs-ref-doc/DataSourceCollection.html?classFilter=DataSo#remove) is responsible for this, but no action is executed. This can easily be reproduced by clicking on the button “Remove” in the above mentioned sandcastle.  
Is this an error or do i miss something?

---

<div class="post-metadata">

**Author:** ![mholthausen](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mholthausen/32/2615_2.png) [@mholthausen](https://community.cesium.com/u/mholthausen)\
**Post date:** [May 18, 2020, 1:35pm UTC](https://community.cesium.com/t/bug-in-removing-a-datasource-from-the-viewer/9653/2 "2020-05-18T13:35:12Z")

</div>

Ignore this; when the `dataSources` are queried by the name, an array is returned from which the respective `dataSource` must be extracted.
