This is a follow-up of sorts to this post:
It was hinted (not promised) that hitTest results would be sorted by draw order by v4.24. As of v4.25 the result array is still random. I can get around this if all layers have an orderBy applied to a field with unique values, but I don't always have that luxury. Otherwise, as far as I can tell, the ability to get the "top most" hit has been gone since v4.23.
I'm curious if the enhancement to sort the hitTest array is scheduled for a release yet. If it's still marinating in the backlog I feel I'm going to have to start exploring alternative approaches. I'd be all ears if there are ways to derive this by digging into the innards of various API objects; my prodding around hasn't been able to find anything.
Appreciate any responses, good day.
Solved! Go to Solution.
Hi there,
As you pointed out that the only workaround for the behavior you describe is here: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clarification-on-4-23-hittest-ret...
We do have plans to support sorting for hittest. But I don't have any dates when this will be implemented.
-Undral
@james-rae as mentioned in this post, the enhancement for the MapView.hitTest() method to respect the map drawing order has been implemented for version 4.29 (releasing soon). The returned features will adhere to the default drawing order of the data or a specific order if orderBy is specified on the layer.
Hi there,
As you pointed out that the only workaround for the behavior you describe is here: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/clarification-on-4-23-hittest-ret...
We do have plans to support sorting for hittest. But I don't have any dates when this will be implemented.
-Undral
Appreciate the response and confirmation of the feature's priority.
@james-rae as mentioned in this post, the enhancement for the MapView.hitTest() method to respect the map drawing order has been implemented for version 4.29 (releasing soon). The returned features will adhere to the default drawing order of the data or a specific order if orderBy is specified on the layer.