From ArcGIS Runtime Java API documentation, there is an identifyLayersAsync() method.
Asynchronously identifies the topmost visible geo-element in each identifiable layer attached to the map, near given screen point.
Is there a way to for ArcGIS Runtime to return a single geo-element belonging to any layer, such that it is the topmost element?
P.S. Also asked on Stackoverflow.
I'm still having this problem. To rephrase it, I need to find out the feature (that belongs to any layer within a list of layers) that the user has clicked on. The feature returned must be feature that the user thought he/she has clicked on (based on visual judgement).
Additionally, the method must work for both maps and scenes.
I'm going to offer bounty on both sites. At this point I'm quite sure that the API doesn't do this out-of-the-box, so I'm looking for work-around solutions.
It looks like my question stating about "topmost feature" has caused some confusion. The "topmost" condition is only true when it is a MapView (2D). What I really need is to identify the feature that the user is actually seeing on the MapView/SceneView when the user does the clicking.
Additionally, features at the bottom layer may have a very high "z" (height) value and may appear nearest to the camera viewport.
If you call
identifyLayerAsync() for a single layer, the API would be able to figure out the feature that is nearest to the viewport. However, the API does not have any mean to do the same analysis taking in all features from all layers (or selected list of layers).