Select to view content in your preferred language

Popup order for multiple layers

252
2
04-10-2024 07:23 AM
JanHellenberg
New Contributor II

I have two overlapping layers, one FeatureLayer and one ImageryTileLayer. Both have popups. When clicking, I would need the popup of the FeatureLayer to come first. Is this possible? 

I have tried adding the layers in different order, and also doing this for my selected feature in my FeatureLayer:

mapView.popup.viewModel.selectedFeatureIndex = 0

..but nothing works and the ImageryTileLayer popup always comes first. Using Arcgis for JS 4.26.

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

In the 4.29 version, the MapView.hitTest method was improved to respect drawing order or use the orderBy property.

BlakeTerhune
MVP Regular Contributor

Which also includes improvements to the popup.

The Popup and Features widgets now display features from multiple layers in the order they are displayed in the map. This means that the features of the topmost layer in the map will appear first, followed by the features of the next layer, and so on. In previous versions, the features were displayed in the order they were returned from the server.