legend dijit

943
6
11-17-2010 07:35 AM
timgogl
New Contributor II
i have gone through the documentation, and looked at the examples.
i have put an example using legends on my server, run it and it works fine.
i have changed the extent and services to reflect the map i want, and i get no legend.

is there something specific that needs to be in the service to allow the legend to work?

my esri guy is out and about today, so i am asking you all.
0 Kudos
6 Replies
JeffPace
MVP Alum
are you doing this in the sample viewer as a widget or just straight up javascript?

make sure after you do

new esri.dijit.Legend({
                map:this.map,
                respectCurrentMapScale:true
            },this.legendNode);

that you do legend.startup();
0 Kudos
timgogl
New Contributor II
yes. i am using the sample: http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm?ArcGISDynamicMapServiceL...

the only thing i have changed is the value of initialExtent and the service for operationalLayer.

everything else is exactly the same.
0 Kudos
timgogl
New Contributor II
heh. im an idiot.... just talked with my esri guy.... after going over everything with him, he was as stumped as i about this...

he just popped in and said, we dont have sp1 yet. heh. we have server 10. will be adding sp1 soon i guess.. then i expect it will work perfectly.
0 Kudos
AlexanderAnkrah
New Contributor III
Hi Folks,
A couple of quick questions on the legend widget.

1. Is it backward compatible? That is would it support services created using Server 9.3.1? We haven't upgraded to Server 10 yet.

2. Does it support Secure Services? Our services are secured and hence tokens are appended to the end of the Service URL. Will this widget support that?

Happy if someone could help with this.

Cheers
0 Kudos
timgogl
New Contributor II
i dont have a definitive answer to your question, but, it would seem that if the legend dijit can read the 'drawing info' section of your service, then it should work, if all of that is hidden because of security, then maybe not.
0 Kudos
Kathleen_Crombez
Occasional Contributor III
Hi Folks,
Is it backward compatible? That is would it support services created using Server 9.3.1? We haven't upgraded to Server 10 yet.


In ArcGIS Server 10 when you view your map service in the service directory you will see a link named "legend" which is the actual legend service. In 9.3.1 this link is not existant. So I would venture to say, no. It is not backwards compatible. Unless you make your map service publicly available and use the legend service through ArcGis.com

from ESRI:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm

"The legend supports the following layer types: ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer, FeatureLayer. If the layer is an ArcGISDynamicMapServiceLayer or ArcGISTiledMapServiceLayer created using ArcGIS Server 10.0 SP1 or higher the legend is generated using the REST Map Service legend resource.

http://mapservice-url/legend

If the layers are version 10 or lower the legend is created using the ArcGIS.com legend service. In order to use the ArcGIS.com legend service your map service needs to be publicly accessible and your application must be able to access ArcGIS.com."
0 Kudos