First let me say that this community is awesome for us new arcgis users!
I have been able to pull the map in and everything is working fantastic, except that I am not able to figure out how to display the legend for a map. This is my last item needed for my project. I am pulling the map in via portal id.
Any help would be greatly appreciated!
Thanks!
Solved! Go to Solution.
I don't believe that there is a Legend view built into the API, but what you can do is for each layer in the map, call Layer| arcgis-android fetchLegendInfoAsync and when it is returned, build the legend from the information provided into any view you wish.
I hope this helps!
I don't believe that there is a Legend view built into the API, but what you can do is for each layer in the map, call Layer| arcgis-android fetchLegendInfoAsync and when it is returned, build the legend from the information provided into any view you wish.
I hope this helps!
Thank you for the response! So for the layers, would these be the operational layers for the map (ArcGISMap.getOperationalLayers())?
Yes
To futher Alexanders reply above, there's a great example of using this method to build a TOC in the Offline Mapbook example app. The app is described here - Offline Mapbook for Android | ArcGIS for Developers - this topic also includes a link to the source code on GitHub so you can use this as a starting point if this helps.