I am making a web application that has a 3D web scene containing two layers. I want to get one of the layers and have users be able to run queries on the table and then the scene show all matching layers, similar to the "Select by Attribute" tool in ArcGIS Pro. I am a beginner to building web apps and I've run into some issues getting the query to work. I am using the following code:
webscene.loadAll().then(()=>{
const sceneLayer = webscene.layers.getItemAt(0);
sceneLayer.outFields = ["*"];
console.log(sceneLayer);
let query = sceneLayer.createQuery();
query.where = "Category = 'Topographic'";
query.outFields = ["Description", "ID", "Link", "Category"];
query.returnGeometry = true;
sceneLayer.queryFeatures(query).then((result) => {
console.log(result.features);
});
The first console.log() returns an Object that shows that shows the correct information for the layer I want to query. However, the second portion (the query) returns this error:
"SceneLayer queries are not available without an associated feature layer"
I uploaded the webscene to ArcGIS Online and all the component layers should be associated to the web scene, so I am confused as to why I am still getting this error.