Removing features in a WebScene and save the changes

332
2
Jump to solution
06-24-2020 02:52 AM
ArthurGenet
New Contributor II

Hello,

I am working on a Web App where users could remove selected features from their SceneLayer and then save the changes in a new WebScene. 

Right now, I have been able to add a filter but it does not save the changes properly. I think I should maybe try to retrieve the objectID of the selected features and work with them but I don't know if it is possible to do something.

Do you have any idea of how I could do it?

Thank you for your help.

Edit: I removed the old code, I've been able to solve my problem, the answer is below

0 Kudos
1 Solution

Accepted Solutions
ArthurGenet
New Contributor II

Done. So the definitionExpression works well for what I wanted but does not completely remove the features, it's just an expression associated to the layer (in ArcGIS Online, it creates a custom filter in the layer properties) 

Here is the code: GitHub - ArthurGenet/webscene-features-remover 

And the Web App hosted on GitHub Pages : Verberg Webscene Features (everything is in dutch but you just need to put a Webscene id and then you can modify it with the tools in the bottom-right and then you can save it, overwrite it or upload a new webscene with the left panel)

Hope it can help some of you.

Have a nice day  

View solution in original post

0 Kudos
2 Replies
ArthurGenet
New Contributor II

Ok I've been able to made it with using a query on geometry and then definitionExpression. 

I will share my code when I will have finished  

0 Kudos
ArthurGenet
New Contributor II

Done. So the definitionExpression works well for what I wanted but does not completely remove the features, it's just an expression associated to the layer (in ArcGIS Online, it creates a custom filter in the layer properties) 

Here is the code: GitHub - ArthurGenet/webscene-features-remover 

And the Web App hosted on GitHub Pages : Verberg Webscene Features (everything is in dutch but you just need to put a Webscene id and then you can modify it with the tools in the bottom-right and then you can save it, overwrite it or upload a new webscene with the left panel)

Hope it can help some of you.

Have a nice day  

0 Kudos