Select to view content in your preferred language

arcGis silverlight api 2.1 Legend Control

4017
19
01-02-2011 10:08 PM
rohandontireddy
Emerging Contributor
Hi iam using 2.1 Legend control fopr displaying legends if i use the map service http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapSe... then im getting the legends properly
but if i use my mapservice http://192.168.16.17/ArcGIS/rest/services/DelhiMain10/MapServer im only getting the layers list legends are not getting displayed.
an i missing something in mapservice ?
0 Kudos
19 Replies
DominiqueBroux
Esri Frequent Contributor
As your service is not public, the legend control can't use the legend service on ArcGIS.com to generate swatches.
So, the legend details have to come from your map service but this is only working from ArcGIS server 10 SP1.

You can test your legend rest end point with a request like : http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer...
0 Kudos
GregoryDillon
Occasional Contributor
We are having the same problem.   Our Dynamic layer is not public, but ArcGIS 10 SP 1 is installed.   We are still not seeing any symbology.   Does the layer have to be public if you have 10 sp 1?  

In addition, we have learned the following:

1) Our layer are consists of 1 parent and multiple child nodes in the Legend TOC.   The TOC part of the legend allow us to expand the parent layer (that is the group layer), but we cannot expand the child node (layers underneath parent group layer) to see the symbology

2) When we created a test FeatureLayer pointing directly to one of the child layers and all the symbology displays for that feature.   Its like the legend won't work for dynamic layers when they are not public???
0 Kudos
DominiqueBroux
Esri Frequent Contributor

Does the layer have to be public if you have 10 sp 1?

No, it should work with private service.

If you request your map service, you should see a Legend hyperlink (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer).

By clicking this Legend Hyperlink, you should see the legend defined by your service (e.g http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer...).

Is this working with your service?
0 Kudos
GregoryDillon
Occasional Contributor
No, it should work with private service.

If you request your map service, you should see a Legend hyperlink (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer).

By clicking this Legend Hyperlink, you should see the legend defined by your service (e.g http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer...).

Is this working with your service?


No the service does not have a legend hyperlink, but I believe we just discovered the ArcGIS Service did not have SP1 (only the desktop is SP1).    I'll let you know when we patch that.
0 Kudos
GregoryDillon
Occasional Contributor
Okay its working now!   Thanks for the info, you pointed us in the right direction
0 Kudos
JollyJacob
Emerging Contributor
We have the same problem. We haven't installed SP1 yet but the legend control works with services created on 9.3.1 but does not work with services created on 10. Any idea why this is so? But we do plan to install SP1 later today and check it out.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Okay its working now! Thanks for the info, you pointed us in the right direction

You are welcome:).




We have the same problem. We haven't installed SP1 yet but the legend control works with services created on 9.3.1 but does not work with services created on 10. Any idea why this is so? But we do plan to install SP1 later today and check it out.

There should not be any difference between 9.3.1 and 10 services. Both are using the arcgis.com legend service but this can work with public services only.
From 10SP1, the map service includes its own legend service.
0 Kudos
JollyJacob
Emerging Contributor
Thanks Dominique, it's working now with SP1 🙂

But we have another problem now, we are wanting to print legends while printing the map and don't want the tree view that comes with the Legend control. What other possible ways could we use to print legends on printouts of maps?
0 Kudos
DominiqueBroux
Esri Frequent Contributor

I..don't want the tree view that comes with the Legend control.
If you set to 'Flat' the LayerItemsMode of the legend control, you won't see any group layers or map services item in the legend.

But even in Flat mode the default legend template is using a tree view (with only 2 levels one for the layer items, one for the swatches).

Then if you need advanced customization, you can retemplate the legend control with any items control you want.
0 Kudos