We solved this, sort of, using hitTest property:
app.mapView.on("click", function(event) {
app.mapView.hitTest(event.screenPoint).then(function(response) {
var result = response.results[0];
var symbol = new SimpleFillSymbol({
color: [255,255,0,0.0],
style: "solid",
outline: {
color: [102,0,204],
width: 5
}
});
app.mapView.graphics.removeAll();
if (result) {
var selectionGraphic = result.graphic;
selectionGraphic.symbol = symbol;
app.mapView.graphics.add(selectionGraphic);
}
});
});
For the view, set up a result to return and a return symbol from the screenPoint location, then for each new result clear the last and add the selectionGraphic.
We also added a watch on the popup's visbile property to handle clearing the grahpic when the popup is closed:
app.mapView.popup.watch("visible", function(visible) {
if (visible == false) {
app.mapView.graphics.removeAll();
}
});
I suppose you could add an action against the esri-icon-close class that could perfrom the same thing . . .
The hitTest works fine in 4.1 EXCEPT when a mouse click selects your feature by that new selection tolerance, producing 'No Features Found' bubble. In this case hitTest won't work because the feature is selected but of course no graphic is generated since there is no feature at the screenPoint mouse click.
So if anybody knows how to get at that tolerance property for the poup, that would be great so we can figure out how to set maybe a hitTest screen tolerance-
Thanks,
David