How to retrieve Drawing info data and renderer values of a layer in a map service

1736
2
04-09-2013 03:17 AM
YardenCochav
New Contributor
Hi,

I need to build a table of content from POI layer resides in a map service.
The categories for drawing the layer are defined in the 'drawing info' section in the layer properties of the rest service.
Unfortunately I didn't find any way to retrieve that data through the java script API

(I am using java script API version 2.5, ArcGIS server version 10.1, ArcSDE 10.1)
I will appreciate any assistance.

Thanks,
Yarden
0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
Have you taken a look at nliu's Table of Contents widget?
0 Kudos
SteveCole
Frequent Contributor
It would certainly be ideal if ESRI provided a method of retrieving this information. If Ken's TOC widget suggestion doesn't work for you, there's always the option of scraping the REST service description page using AJAX and YQL.

I used the code in the link above as a base in order to extract file names from an HTML version of a FTP file directory listing. I suppose you could pass the URL to the REST Service directory of the layer you're interested in (what you previously described such as this) and the process the results to extract the info you need.

Not pretty- but doable.

Steve
0 Kudos