AnsweredAssumed Answered

mapview.hitTest doesn't return results if opacity is set

Question asked by Jefairfi on Oct 2, 2017
Latest reply on Dec 18, 2017 by dcoley

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:

 

JS Bin - Collaborative JavaScript Debugging 

Outcomes