thanks for the prompt reply, I found the function: FeatureLayer | API Reference | ArcGIS API for JavaScript 4.0
There are also some documentation about the query: Query | API Reference | ArcGIS API for JavaScript 4.0
But what I want to do essentially is that I can select a feature with mouse click. I'm actually using SceneView, so the features are 3d features.
I try to do the query based on geometry on mouse click event:
view.on("click", function(evt){
// evt is the event handle returned after the event fires.
console.log(evt.mapPoint);
var query = new Query();
query.geometry = evt.mapPoint;
lyr.queryFeatures(query).then(function(results){
console.log(results.features);
})
});
but it gives me the error:'name: "QueryEngine", message: "Invalid query", details: undefined'.
It looks like the query function only supports ArcGIS Online hosted feature service(s) or ArcGIS Server service(s)?
My features are rendered by client-side graphics.