My scenario:
- I have a drawing "point" icon for my map. When I click on a region in US, I want to highlight that region. I can get the highlight done. When clicking on a region, I don't want to run the query task again to get the region that contains the point. So, my design is I go thru the existing graphic list and find the region that "intersects" with that point, then do the highlight.
Something like this:
if (graphic.Geometry.Extent.Intersects(e.Geometry.Extent))
{
graphic.Select();
}
e is DrawEventArgs. graphic is from graphic layer on the map.
However, I got a problem that sometimes 2 regions contain that point and the result is both of them are selected. Please see the attached image, my clicking point is at the crossed symbol x. When I click at that point, both regions A and B are selected while I only want region B is selected.
Is there a way to fix this? Looks like to me graphic geometry is a rectangle and that causes the point to be inside both regions in the image?
I appreciate your help!