Order of feature layer pop-ups

4551
4
01-20-2015 08:13 AM
AneteFridrihsone
New Contributor II

Hello,

I've been struggling with setting order for feature layer pop-ups. There are two overlapping feature layers in my mapView, but only one layers pop-ups can be accessed. How can I set which pop-up to show regardless of layer order in (arcgis online) map??

 

For example, there are points on polygons. And by clicking on it, I need to access points pop-up and not polygons.

Please advice! Ive been using arcgis android sample "WebMap Popup Editing".

 

The corrections should take part in this segment of code:

 

code help.PNG

0 Kudos
4 Replies
XuemingWu
Esri Contributor

Hi Dian Aggreani,

There are two ways to set which popup to show.

1. Popups are displayed in the order of when they are added to the PopupContain. In the above sample, popups are added to the PopupContainer through two async RunQueryFeatureLayerTasks. Since these two tasks are invoked in two different threads, you can't expect the order of the popups. If you change the logic to query the feature layers one by one then add popups to PopupContainer one by one, you will be able to show popups  in the order you want.

2. Use PopupContainer and PopupContainerView to set which popup to show. You can use PopupContainer.setCurrentPopup to show a popup at specific index. You can also set the OnPageChangeListener on PopupContainerView to handle user interaction.

PopupContainer: getCurrentPopup(), getPopupCount(), getPopupContainnerView(), setCurrentPopup()

PopupContainerView: setOnPagechangeListener(), setCurrentPopup()

Hope this will help.

cheers.

0 Kudos
AneteFridrihsone
New Contributor II

This is GREATLY helpful! Thank you very much! It answered many questions.

by Anonymous User
Not applicable

Mind explaining how to implement this in a WAB Developer edition application? I've been struggling with this. 

If I can define the order manually, I'd be happy as a clam

0 Kudos
XuemingWu
Esri Contributor

Hi Andrew,

Could you please ask this question in the WAB related thread at 

https://community.esri.com/groups/web-app-builder-custom-widgets? Esri staff and users in that thread will have more insight for your question. 

Cheers.

0 Kudos