AnsweredAssumed Answered

Popup event order

Question asked by AndyEgleton on Sep 13, 2016
Latest reply on Sep 14, 2016 by AndyEgleton

I've been working on a custom popup widget using the JavaScript popup object, calling a number of external services with deferred results, meaning I need to manually create the popup content. I've noticed an issue with the order of the popup events, set-features and selection-change.

A have a single ArcGIS server map service with 4 layers, added to portal as a map image layer.
This map image layer has been added to a web map, and my app uses this web map.
My custom popup has been configured on all 4 layers.
When clicking on a feature in any layer that isn't the last layer (i.e. id 0-2), the popup is triggered with a selection-change then set-features.
When clicking on a feature in the last layer (i.e. 3), the popup is triggered with set-features then a selection-change.

This makes coding the calls to external services and generating the popup content a lot more complex than it needs to be, ideally I would make one call to my services on set-features, then generate content on selection-change, but this issue prevents that.

Is there a reason for the change in event order for the last layer in a service?
Is there anything I can change to make the events occur in the same order for every layer?