Multiple task.identify on click not working correctly
Hey everyone,
we are very frustrated with VSW's lack of order when identifying features in a map, something that an Experience Builder App or even the basic ArcGIS Webmap get right, but VSW doesn't.
In an attempt to fix this, I'm currently experimenting with the following custom command, triggered when clicking in the map, which is attempting to “chain" two task.identify commands:
[
{
"name": "tasks.identify",
"arguments": {
"visibleLayersOnly": true,
}
},
"results.display-details",
{
"name": "tasks.identify",
"arguments": {
"visibleLayersOnly": false,
"maps": [],
"sources": [
"item://layer-extension/105e6f8d-ab9d-4ac7-b61d-5a717e4c16f2",
"item://layer-extension/a303dc2f-78aa-46bf-b4e5-abb6c26be756"
]
}
},
"results.display-details"
]
This is supposed to do the following:
1. Identify all visible features in the map and display the result details. Since this task is first in the custom command, presumably it is being executed first and thus displaying the selected features first
2. Identify a set of invisible features which are always supposed to be the last in the result order
Unfortunately, this doesn't work. What it does instead is select a bunch of features not just on the point I clicked, but all over the map:

Does anyone know how to fix this? Or have I stumbled over a bug here?
-
Hello Andreas,
If this is a function that you need specifically, it would be best to create a custom workflow for it.
The command you posted has a few issues. The first is due to command chaining. Identify takes the context input of the commands before it. In this case you are feeding the second identify the results from the first - this is likely why you seem to get getting a number of unexpected results.
Another issue here is using results.display-details twice. If you would like all the results to appear in the same results session, you would want to use results.add for the second call.
The last issue challenge you are facing is that tasks.identify works asynchronously. The result of this is that results will dribble in as they are ready and will not return in the same order every time.
0 -
Thank you Brandon! I will look into solving this with a workflow.
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires