Select to view content in your preferred language

Simple Legend Problem

1386
7
06-14-2011 12:11 PM
TomJansen
Emerging Contributor
I'm trying to create a simple legend that shows the layers and symbology from a Dynamic Map Service.  When I use code from the ESRI legend component sample the legend appears as an icon with a red circle crossed out.  Attached is the icon, below is my code. Any ideas why this is happening?  Thanks.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:esri="http://www.esri.com/2008/ags"
      pageTitle="Legend Component">
 
 <esri:Map id="myMap">
  <esri:extent>
   <esri:Extent xmin="-10753431" ymin="4624151" xmax="-10737799" ymax="4635884">
    <esri:SpatialReference wkid="102100"/>
   </esri:Extent>
  </esri:extent>
  
  <esri:ArcGISDynamicMapServiceLayer id="baseLayers"
   url="http://arc-srv-02/ArcGIS/rest/services/Flex_Services/Scott_Base_Layer_Flex/MapServer/">
  </esri:ArcGISDynamicMapServiceLayer>
  
 </esri:Map>
 
 <esri:Legend id="myLegend"
     width="250" height="100%"
     layers="{[ baseLayers ]}"
     map="{myMap}"
     respectCurrentMapScale="true"/>
 
</s:Application>
Tags (2)
0 Kudos
7 Replies
KomanDiabate
Deactivated User
I believe you need server 10 to have the legend working properly or you will get the cross over layer symbol..
0 Kudos
TomJansen
Emerging Contributor
Thanks for the response...though I am using server 10.
0 Kudos
R__CraigHolmes
Emerging Contributor
double check your spatial reference
0 Kudos
ZahidChaudhry
Deactivated User
double check your spatial reference


Check from the service directory
http://arc-srv-02/ArcGIS/rest/services/
and you should be able to see your legend. If you can see it there, you can generate it in your app..
0 Kudos
KenBuja
MVP Esteemed Contributor
Have you set the visible layers for the service?
0 Kudos
MatthewZetterholm
Emerging Contributor
Just wondering if you ever resolved this issue?  I am having the same problem.
0 Kudos
KomanDiabate
Deactivated User
Make sure you are running server 10 and you can see Legend info in your map rest service. The legend is being drawn from the rest services
0 Kudos