Thank you for your community forum post! Unfortunately, I am not able to read your post. It’s possible that some other community forum members can help you out here. Alternatively, if you can translate your question to English, and I can try to solve your issue :grinning:


Per Google Translate:

Load multiple geojson format layer data, control layer display and hide through tree, tried datasource.remove() method, return false, is there any way to control the layer display or hide, or remove the layer directly.

@scottUFR @javaLiu

I wonder if the datasource object has a show property. If so, a potential solution could be setting show: false. Moving forward, more information on datasource would be helpful. Is datasource an ImageryLayer?


Make sure you are waiting for the GeoJsonDataSource’s promise to resolve which will give you the handle to be used when you call Viewer.dataSources.remove(myDataSource). You may need to subscribe to the dataSourceAdded event on DataSourceCollection.

You should be able to use myDataSource.show = false to hide the data source’s entities.

1 Like

@scottUFR great point :+1:

@javaLiu be sure to keep this in mind.