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?
Solved! Go to Solution.
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
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
Hi RamaChintapalli,
How about the sublayer is feature layer?
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