Hi folks,
I have a MapImageLayer which sublayer symbolizes roads of a country on a map. I want to sketch a rectangle over these Roads and get the intersection points (including the routes themselves) back.
So basically what I have is the MapImageLayer, which features I can also query but the only thing I get back are obviously all routes - I need to query it based on the "rectangle selection" which is currentyl sketched in a GraphicsLayer using the SketchViewModel.
Thanks in advance for your help!
Have you looked at the geometry engines intersect method? Might be what you are looking for.
Do you have a simple CodePen showing what you've tried so far? The simplest approach is to use the queryFeatures() method on the Sublayer. You might also consider converting the Extent to a Polyline to simplify the intersect operation.
Hi there,
This simple test app show how to query features of a sublayer that intersect a rectangle. You'd have to modify it so that that you are querying all sublayers you need to query. Hope this helps.
...and here's a slight modification to above codepen that shows how to only get features that intersect the extent boundary:
https://codepen.io/john-grayson/pen/GRNKPjw