How to get legend images from map service info of any layer in SDK v100.x

04-30-2018 07:34 AM
New Contributor III


I need to get legend images from map service info. In Previous run time SDK v 10.x, we have used to get the images as below.

-(void)Save:(AGSMapServiceInfo*)mapServiceInfo{for (AGSMapServiceLayerInfo* info in mapServiceInfo.layerInfos){   [self saveInfo:mapServiceInfo images:info.legendImages labels:info.legendLabels];

I tried to get the legend images from the below layer


But, no luck. Im not able to find any document regarding this, even in migration document. Kindly give some suggestions to find out the classes replaced in latest run time SDK for iOS.


0 Kudos
1 Reply
Esri Contributor

Thank you for your question!  We do have equivalent functionality in the 100.2.x release of the Runtime SDK.  It can be found in the AGSLayerContent protocol on all AGSLayer subclasses.  You can use the fetchLegendInfos: method to retrieve the legend information for a layer/sublayer.

Take a look at this GeoNet comment: 

If that doesn't answer your question, or you need clarification, please let me know.