I'm new to the Java runtime. I'm trying to get the extent for each sublayer which I assumed would be available by calling
getMapServiceSublayerInfo().getExtent() butgetMapServiceSublayerInfo()
always returns null.
I've tried with our map service and the ESRI sample service
http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer
Guidance would be much appreciated.
Jack
Hi Jack: You are explicitly loading the `ArcGISMapImageLayer` but not the sublayer.
ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer");
mapImageLayer.loadAsync();
mapImageLayer.addDoneLoadingListener(() -> {
final ArcGISMapImageSublayer testSublayer = (ArcGISMapImageSublayer) mMapImageLayer.getSublayers().get(0);
testSublayer.loadAsync();
testSublayer.addDoneLoadingListener(() -> {
ArcGISMapServiceSublayerInfo testInfo = testSublayer.getMapServiceSublayerInfo();
});
});