| Numéro d’ID de bogue |
BUG-000114472 |
| Envoi | June 5, 2018 |
| Dernière modification | June 5, 2024 |
| S’applique à | ArcGIS Runtime SDK |
| Version trouvée | 100.2.1 |
| Système d’exploitation | Windows OS |
| Version du système d’exploitation | 7.0 64 Bit |
| Statut | Will Not Be Addressed
L’équipe de développement a examiné le problème ou la demande et a décidé qu’ils ne seraient pas traités. Pour d’autres explications, reportez-vous à la section Informations supplémentaires correspondant au problème.
|
Informations supplémentaires
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();
}
});
}
Étapes pour reproduire
ID de bogue: BUG-000114472
Logiciel: