Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Been using Esri JavaScript for a while but just started trying out the silverlight API but things are not going smoothly!

Tasks that I used to accomplish easily with Javascript is now proving unreasonably long and even unsolvable when using silverlight.

I am looking to create a little tool to add to the silverlight viewer. The tool interface has a listBox a Button and a ComboBox.

The logic is that The listBox will have hard-coded serviceURL's. User selects a serviceURL, clicks on the button and the tool display the layers/map information in the comboBox.

JavaScript did this easily with GetResourceInfo etc but I just don't know where or how to carry this out with SilverLight.

Any help will be very much appreciated.

share|improve this question
add comment

1 Answer

In the Silverlight API, downloading of the service information is not exposed directly. Instead, it is encapsulated in the concrete layer type.

E.g. for dynamic AGS services, you need to create an instance of ArcGISDynamicMapServiceLayer, set the Url property and Initialize the layer. Keep in mind that the initialization is asynchronous (and involves downloading of the service description JSON) and fires the Initialized event (also see the InitializationFailed event).

Once the layer is correctly initialized, you can access the service information in a structured manner, which is exposed via the layer properties - e.g. the Layers property.

If more complete information is needed, you may have to also call the GetAllDetails method. It is also asynchronous, this time not via events, but via a completion callback, which provides you with the full description of every layer/table in the service.

share|improve this answer
    
Thanks Petr for getting back to me. Though this has given me an insight I still can't seem to get it right. The ESRI silverlight API site has a sample link. This works great. Pretty much what I want to do but the only issue is extending this to tell if the URL provided is for a Dynamic map service or a Tiled map service and drawing it accordingly. Happy if you could help with a little code. –  bluerace May 26 '12 at 17:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.