AnsweredAssumed Answered

HitTestAsync for invisible graphics

Question asked by ChristinaElaine on Dec 9, 2015
Latest reply on Dec 11, 2015 by mnielsen-esristaff

I am calling HitTestAsync(MapView, Point) from within a MapViewTapped handler. On the first click, the Graphic g is found, so I set g.IsSelected=true. On the second click, it is found again, so I put it in edit mode by calling Editor.EditGeometryAsync(g) and I set g.IsVisible=false so that only the editing version is visible. This all works. However, when I click a third time, the hit test returns null, which I'm assuming is because the shape is invisible. I don't want to deselect the graphic, but since it isn't found with a hit test, there is no way to know if it's been clicked, so my selector logic deselects everything thinking that nothing was clicked.

 

Is there a way to convince the hit test to see my invisible graphic or see the graphic on the Editor layer? Right now the only thing I know to do is to set the Symbol colors for the graphic to Transparent instead of setting it to invisible so that the hit test will still find it but it won't be seen on the map, but that seems hacky.

Outcomes