Select to view content in your preferred language

Want to retrieve a list of layers and sublayers

706
3
Jump to solution
02-16-2022 08:41 AM
BTDS_GISAdmin
Emerging Contributor

I am using the SDK 100.10.0. When I tried to using to list the layer and the sublayer it has. However, it is always show 0 for sublayer. I know some layer has sublayers. 

 

for(Layer layer: map.getOperationalLayers()){
   Log.i(TAG, layer.getName());
   Log.i(TAG, layer.getSubLayerContent().size());
}

 

 What is the correct way to retrieve the sublayer info?

0 Kudos
1 Solution

Accepted Solutions
RamaChintapalli
Esri Contributor


Sample ArcGISMapImageLayer URL: 
https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer

Sample FeatureLayer URL: 
https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0

Here is the hierarchy,

Map
    - Operational Layers 
           -  ArcGISMapImageLayer
                         - ArcGISMapImageSubLayer - ServiceFeatureTable
           - FeatureLayer
                         - ServiceFeatureTable

A feature layer cannot have another feature layer as a sublayer. However you can create a FeatureLayer from an ArcGISMapImageSubLayer's table since both of them can be backed by a ServiceFeatureTable.

Thanks

Rama

View solution in original post

0 Kudos
3 Replies
RamaChintapalli
Esri Contributor

Hi,
The SubLayers for an operation layer depends on the type of the layer you are using. For example, ArcGISMapImageLayer will have the sublayers where as a FeatureLayer does not.

Here is a sample that demonstrates querying sublayer information from an ArcGISMapImageLayer,
https://github.com/Esri/arcgis-runtime-samples-android/tree/main/java/query-map-image-sublayer

Thanks
Rama

0 Kudos
BTDS_GISAdmin
Emerging Contributor

Hi RamaChintapalli,

How about the sublayer is feature layer?

0 Kudos
RamaChintapalli
Esri Contributor


Sample ArcGISMapImageLayer URL: 
https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/MapServer

Sample FeatureLayer URL: 
https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0

Here is the hierarchy,

Map
    - Operational Layers 
           -  ArcGISMapImageLayer
                         - ArcGISMapImageSubLayer - ServiceFeatureTable
           - FeatureLayer
                         - ServiceFeatureTable

A feature layer cannot have another feature layer as a sublayer. However you can create a FeatureLayer from an ArcGISMapImageSubLayer's table since both of them can be backed by a ServiceFeatureTable.

Thanks

Rama

0 Kudos