Dynamic Rest Legend in ArcGIS Server 10 and Flex API 1.3

3551
28
08-13-2010 07:26 AM
JasonHancheruk
New Contributor II
I just upgraded ArcGIS Server to version 10 from 9.3.1. When I open the Flex page through the browser, instead of the dynamic legend loading, the wait for legend creation just keeps spinning.

Is there a way to fix this problem?
Tags (2)
0 Kudos
28 Replies
RobertScheitlin__GISP
MVP Emeritus
Jason,

   Look for this line in your LiveMapsWidget.mxml

if (ArcGISDynamicMapServiceLayer(liveLayers).id != "Aerial Photography")


and change "Aerial Photography" to the id of your raster map service.
0 Kudos
JasonHancheruk
New Contributor II
Okay, what if I have 3 different IDs for various raster data?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jason,

   Didn't you say you have one MAP SERVICE that has your rasters in it?
0 Kudos
JasonHancheruk
New Contributor II
Sorry, maybe I am getting my terminology wrong. I have 3 MXDs published as a mapservice, and have added them into the livemaps section in the cofig.xml. Two of the mapservice's have vector data, but the third mapservice has 3 different layers which are all rasters.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jason,

    So the label of the map service in the config.xml that has the rasters that is what you use to replace in that line of code then.
0 Kudos
JasonHancheruk
New Contributor II
Thanks Robert.

The label name did the trick.
0 Kudos
AimeiChen
Occasional Contributor
Hi, Robert
I like the dynamic legend widget a lot and trying to load it into my project. I have ArcGIS Server 9.3.1and SFV1.3, After modified the source code and tried to run my flex project, I got error "There are no visible layers, or map legend generation failed!". But when I check the server, the png files were written to c:\\gisserver\arcgisoutput\xxxxx.png, and I can open them with IE.

I don't have any raster image on server, and I notied I have map service just for labeling, so I excluded that by change (ArcGISDynamicMapServiceLayer(liveLayers).id != "labeling").

Do you have any idea about what else I missed? I attached the livemapswidget in a zip file, when you get any chance , would you please take a look for me? Thanks for your help!

Amy

Jason,

   Open a web browser and test if the web service is doing what it is suppose to. So on the ArcGIS Server machine that you ran the setup on type "http://localhost/restLegend/restLegend.asmx" and then click on generateLegends and type in some default values like:

soapUrl:   http://services.arcgisonline.com/ArcGIS/services/Demographics/ESRI_Diversity_US_2D/MapServer
dpi:  96
pWidth:  20
pHeight:  20
serviceName:  Test

That should return a XML result.
0 Kudos
AshleyOwens
New Contributor II
Robert - For widget "Dynamic Legend Widget For Flex Viewer 2.3.x", am I correct in assuming it will not work for a Flex 2.1, ArcGIS Server 10.0 configuration?  If so, does a version compatible with Flex 2.1 exist?
Thank you,
Ashley
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ashley,

   I am unsure about backwards compatibility but I would suggest trying. As Flex Viewer 2.4 is coming out this week it's probably long over due to update though...
0 Kudos