laptop and a wrench

Bug

The fetchLegendInfoAsync method does not return any legend information.

Last Published: December 4, 2019 ArcGIS Runtime SDK
Bug ID Number BUG-000114472
SubmittedJune 5, 2018
Last ModifiedJune 5, 2024
Applies toArcGIS Runtime SDK
Version found100.2.1
Operating SystemWindows OS
Operating System Version7.0 64 Bit
StatusWill Not Be Addressed

Additional Information

Legend information is being requested at a level in the service where there is no legend. The legends are in the sublayers which can be seen here for example: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0 Below is sample code to show how to iterate over the sublayers and access the legends: ArcGISMapImageLayer layer = new ArcGISMapImageLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer"); map.getOperationalLayers().add(layer); layer.loadAsync(); layer.addDoneLoadingListener(new Runnable() { @Override public void run() { // TODO Auto-generated method stub System.out.println("Layer loaded" + layer.getLoadStatus().toString()); //System.out.println("Layer loaded" + layer.getLoadError().getCause().toString()); SublayerList subLayerList = layer.getSublayers(); for (ArcGISSublayer subLayer : subLayerList) { System.out.println("sublayer name" + subLayer.getName()); ListenableFuture> future = subLayer.fetchLegendInfosAsync(); future.addDoneListener(()-> { try { List legendInfoList = future.get(); System.out.println(" - legend info size" + legendInfoList.size()); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ExecutionException e) { // TODO Auto-generated catch block e.printStackTrace(); } }); }

Steps to Reproduce

Bug ID: BUG-000114472

Software:

  • ArcGIS Runtime SDK

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options