Select to view content in your preferred language

May service layers

650
1
06-18-2013 12:16 PM
NadeemQazi
Regular Contributor
I have a published a May service consisting of many layers on ARCGIS Server. I want to access from flex application the layers array of this map service in order to assign this layer array to esri legend control in flex application. Is there any way to access the layers in the published map services. please note I am using flex API under flash builder 4.6. Any advice.
regards
nadeem
Tags (2)
0 Kudos
1 Reply
JoeHewitt
Regular Contributor
getAllDetails: http://resources.arcgis.com/en/help/flex-api/apiref/index.html?com/esri/ags/layers/supportClasses/Al...

can return a layersDetails which is an array of detailed information about each layer in a map service.

Example:
   
myMayService.getAllDetails( new AsyncResponder(
function myAllResultFunction(result:AllDetails, token:Object = null):void
{
layerDetails = new ArrayCollection(result.layersDetails);
       
},
function myFaultFunction(error:Object, token:Object = null):void
{
Alert.show(String(error));
}
));



But to assign it your legend should automatically happen when you check the layers on assuming you have already added your service.
0 Kudos