Select to view content in your preferred language

Runtime SDK drawing order for services containing group layers

1107
4
Jump to solution
03-16-2023 03:18 PM
greg_eam
Occasional Contributor

Hello,

One of my organization's clients brought our attention to a discrepancy in Web Map layer drawing order between the ArcGIS JavaScript API, and the ArcGIS Runtime SDKs for iOS and Android. This seems to occur when the Web Map contains group layers.

For example, here is the drawing order of a service containing group layers that we published and added to a new Web Map:

service.png

Here is how the layers are drawn in the ArcGIS Portal Web Map viewer (it looks the same in our web app that uses the JavaScript API). Notice that Parcels are drawn on top of Parks, as defined in the service:

portal.png

However, in our iOS app that uses the ArcGIS Runtime SDK, Parks are instead drawn on top of Parcels (the same is true in our Android app). Neither app modifies layer drawing order while loading a map:

ios.png

Is this expected behavior in the ArcGIS Runtime SDKs? If so, is there any way override it?

Our iOS app uses version 100.14, and our Android app uses 100.15.

Thanks,

Greg

0 Kudos
1 Solution

Accepted Solutions
greg_eam
Occasional Contributor

After messaging with Nick, and further investigation on my end, I have determined the cause of my issue.

Part of my app's loading process for a map involves setting the opacity for each layer based on saved values. It turns out that setting the opacity property on any AGSArcGISMapImageSublayer object (docs here) in my map is triggering the Runtime SDK to redraw the layers.

It's uncertain whether or not this is a bug in the Runtime SDK, but the SDK team is going to look into it. I was able to work around my issue by adding conditions for setting each layer's opacity during map load, instead of setting it automatically.

View solution in original post

0 Kudos
4 Replies
Nicholas-Furness
Esri Regular Contributor

Hi Greg. Thanks for the detailed info. Looks unexpected and could be an issue with group layers.

Are you able to try in ArcGIS Pro and let us know how it renders there please?

Thanks!

Nick.

0 Kudos
greg_eam
Occasional Contributor

Hi Nick,

I just opened the map in ArcGIS Pro. Looks like it renders the same as the Portal viewer and JavaScript API:

greg_eam_0-1679348399902.png

 

Nicholas-Furness
Esri Regular Contributor

Thank you for checking. We'll look into it.

greg_eam
Occasional Contributor

After messaging with Nick, and further investigation on my end, I have determined the cause of my issue.

Part of my app's loading process for a map involves setting the opacity for each layer based on saved values. It turns out that setting the opacity property on any AGSArcGISMapImageSublayer object (docs here) in my map is triggering the Runtime SDK to redraw the layers.

It's uncertain whether or not this is a bug in the Runtime SDK, but the SDK team is going to look into it. I was able to work around my issue by adding conditions for setting each layer's opacity during map load, instead of setting it automatically.

0 Kudos