Select to view content in your preferred language

2.1 Legend and Raster Layers

2854
5
11-19-2010 09:35 AM
DanielWalton
Frequent Contributor
I love the new legend control in 2.1. I am wondering if there is any way to set up symbology for a raster layer in ArcMap so that the service can pick up a symbol for the legend. Is it possible?

Thanks!
0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
Yes, it's possible to customize the legend tree on the event 'Legend.refreshed'.

Ryan did it and gave his code here : http://forums.arcgis.com/threads/17674-2.1-LegendItems-Always-Null
0 Kudos
AlexanderAnkrah
Deactivated User
I hope this thread is still active....

I have a couple of map services (created using 9.3.1) and I was trying to use the legend widget referencing the 2.1 JS API. This is however not working right. The container to hold the legend displays "Loading Legend..." then after a few seconds says "no legend to display". This might be a daft question but is the legend widget backward compatible? is anyone else experiencing this?

Any help would be very much appreciated.

Cheers
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Hi Don,

Looks like you are working with JavaScript API, not with Silverlight.
You might have more chance to get an answer by posting your question on this forum : http://forums.arcgis.com/forums/15-ArcGIS-API-for-JavaScript
0 Kudos
DanielWalton
Frequent Contributor
Yes, it's possible to customize the legend tree on the event 'Legend.refreshed'.

Ryan did it and gave his code here : http://forums.arcgis.com/threads/17674-2.1-LegendItems-Always-Null


Thanks Dominique. I'm not so much interested in customizing the legend as getting it working with Map Services. I think that my problem is that our services are hosted on an AWS instance running AGS 10 (NOT SP1). There seems to be a problem with the way the legend symbols are served via ArcGis.com. I guess we can wait for SP1 images to show up so we can take advantage of the new legend service.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You are right. The legend REST end point is available from AGS 10 SP1.
The fallback mechanism, using arcgis.com legend service, needs a publicaly visible map service.
0 Kudos