Why doesn't the mapview.hitTest method return any results?
Consider the simple example below:
If you modify this sample:
Access features with pointer events | ArcGIS API for JavaScript 4.5
and add the opacity property to the feature layer like this
...
var layer = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/1",
opacity: .4,
outFields: ["*"]
});...
The hit test response will not contain and values in the results array.
Here is a jsbin link showing what I am talking about:
Thanks for the info on this Thomas et al, I thought I was going crazy. I'm hoping the highlight for 2D will be available soon as well, since hitTest only works on the top-most feature
Just to confirm. This is resolved when using the 4.6 version of the api.
Regardless that the API Reference
Popup | API Reference | ArcGIS API for JavaScript 4.6
still says only works in 3d?
You are referencing something unrelated. There is a hitTest method in both MapViews and SceneViews. The sample should work in 2d and 3d.
Sorry about that, yes of course. For some reason I was thinking hightlightSymbol