Select to view content in your preferred language

How to get access the metadata of each layer in the map service and display it?

953
2
06-03-2011 02:12 PM
DanDong
Deactivated User
Hi guys,

I want to implement such thing in my application: When the users right click one of the layers on the layerlist, a childwindow will show the metadata of this layer.

According to the sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LayerList
I know we can access description and copyright of the map service, but how can I access each layer's description and copyright within one map service?

Any thoughts or sample codes are appreciated! 🙂
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Descriptions and copyrights of sublayers are not available out of the box with the SL API.

Nevertheless these infos are available with the REST API but you have to request and deserialize by yourself the REST end point.
You can either request one specific sublayer (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Diversity_Index/MapServer/1?f...), or, from 10.0, request all layers at a time (http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Diversity_Index/MapServer/lay...)
0 Kudos
DanDong
Deactivated User
Thank you Dominique for your hits! I am a brand new in REST API, so I spend these days learning it. But turns out the metadata has already been prepared in html files and I need to use the right button click event to display those html pages. So I use below method to open a new browser window to display the html pages. But I feel very happy that I know that if I want to get access to the sublayer's metadata, I need to resort to REST API. Thank you very much 🙂

string htmluri = "something";
HtmlPage.Window.Navigate(new Uri(htmluri), "");
0 Kudos