Popup event order

1234
2
09-13-2016 04:04 AM
AndyE
by
New Contributor II

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?

Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Andy,

  That sounds like a FEATURE of the JS api and there is nothing you can do to change that behavior except contact esri tech support and log a bug so I can be addressed in the next release.

AndyE
by
New Contributor II

Thanks Robert,

I'll send in a report, I've added a quick and messy work around for the time being (pop-up content gets drawn twice, usually fast enough to be unnoticeable).

0 Kudos