adjusting feature order in default WAB map click infowindow popup

317
1
06-05-2020 02:35 PM
JohnBrosowsky1
New Contributor

In a WAB app an info window pops up when a user clicks on a feature on a layer in a webmap. If the click point intersects multiple features in the layer then information for the first layer detected displays, and the info window popup title bar displays text like (1 of 2) and displays a button for the user to cycle through the detected feature, which is great.

However I am looking for a way to control order of features in this case.  For example I have a map layer of polygons that may overlap. Each polygon has a feature attribute containing a value like "primary" or "secondary" or "backup".  Desirable functionality when clicking on the map is to see the "primary" record information first, and then the user can use the title bar buttons in the info window popup to examine the secondary and backup features if desired.

The default behavior feature order appears to be random.  I suppose it may be based on OID / order of feature creation.  In any case I would like to modify the information window popup in the map click scenario to force the correct feature order.

Has anyone encountered this and determined a solution in Web Appbuilder Developer Ed.?

Thx!

JB

0 Kudos
1 Reply
johnbrosowsky
Occasional Contributor

found a solution here that modifies PopupManager.js: ArcGIS Online - Order Popups same as Legend 

… and then modifying sortFeatures: function(features)  as needed for my particular sorting requirements.  Seems to work great! 

0 Kudos