Hi
If I have a GraphicsLayer with say 3 graphics added to it that overlap is there a way from a click on the overlap area to return all three graphics?
I started with view.hitTest(), but this only returns the topmost graphic, not all graphics under the click.
I then looked at layerView.queryFeatures() but the promise never occurs so I wonder if this does work with a Graphics Layer?
So basically, using v4 is there a way to get all graphics from a single Graphics Layer that intersect a point (cliick).
Many Thanks,
Tony,
A GraphicsLayer has a GraphicsLayerView and a queryGraphics method (not QueryFeatures).
Hi Robert
I did see that, but there are no parameters to pass in a query/geometry; so it looks like all that does is return all graphics from a Graphics Layer rather than a subset?
Thanks,
Tony
... the only thing I could think of was using contains/intersects from the geometryEngine)against each graphic.geom, but it seems a but OTT.oes not offer the
I find it a little odd that hitTest only offers the top most
Tony,
Now I remember. The recommendation from the team is to use a FeatureLayer from a graphics collection instead.
Hi Robert,
Not sure what you mean. Create a FeatureLayer from a graphics collection to then query?
Thanks,
Tony,
Yes instead of using a GraphicsLayer, use a FeatureLayer and then you can use queryFeatures.
Oh wow, OK,
I am using the SketchViewModel for the drawing/transformation part of the application. Seems like this is going to be a real pain to to flip back and forward from the GraphicsLayer to FeatureLayer just to allow selection of overlapping graphics.