Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

121050
664
12-01-2010 07:30 AM
RobertScheitlin__GISP
MVP Emeritus
All,

Here is the next in my line of widgets for the FlexViewer 2.x.

The legend portion of this widget is the same code as my dynamic legend widget so,

IT IS FOR ARCGIS SERVER 10 OR GREATER ONLY

This is just a simple TOC Widget that includes my dynamic legend component.
This widget also includes my enhancement for map service transparency,
right click context menu for zoom to make layer visible, and my scale
dependent renderer for the TOC checkboxes.
Tags (2)
0 Kudos
664 Replies
giuseppemolinario
Deactivated User
Robert,

Thanks so much for providing this widget! I got it up and running in no time. Having the ability to adjust transparency is particularly useful for my application (I was bummed that ESRI removed that option from version 2.x).

I too have rasters in my map and when I was using the ESRI legend widget the 2 rasters that have a classified renderer did show up in the dynamic legend (the one raster I have displayed with a stretched renderer did not). It won't be too hard for me to work around this by converting the rasters to polygons but I just thought I'd point that out.

I also noticed an issue in the legend where I have layers classified by unique values. In a couple of cases I have multiple unique values grouped together and in these cases there are multiple entries showing up in the legend, whereas in the ESRI legend widget this was not the case (see attached screenshot). At any rate, I can certainly work around this as well and your widget is heaps better in many other ways.

cheers,
Chris


Hi Chris, can you write a little about how the rasters were published, and how they were classified (if it was a particular classification tool or something, what do you mean by renderer?) to make them show up on the ESRI legend? I found no info on this.

Thanks a lot -

Giuseppe
0 Kudos
PedroGarcia
Deactivated User
Hi Robert,

I'm using arcgis server 9.3 with your widget. Testing the option 'Zoom to make visible' with a service that have 2 layers displayed at different scale range, when I load the service only is visible one layer, so I place the cursor above the another one and select zoom to make visible , and works fine (and the first one is now not visible). However when I make zoom to the first one to make it visible again, it doesn't work, that is, as if you hasn't pressed any buttom. It seems as if 'Zoom to make visible' only works as Zoom +, and not as Zoom -. Any idea?

Regards, Pedro.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Pedro,

   If you look at my site http://gis.calhouncounty.org/flexviewer2.0/ and right click on Annotation and zoom to make visible and then scroll down to county boundary and do the same you can see that the zoom in and out to scale works fine. So the Question is how do you have your min and max scales set on your data that is causing it not to work?...
0 Kudos
KarlWilson
Frequent Contributor
Hi Robert,

I'm having trouble excluding specific layers from the legend.

I'm using the <legendexcludelayers> tag like so:

 <legendexcludelayers>
  <!-- Both map services and map service sub layers can be excluded -->
  <legendexcludelayer layer="Bathymetry">1</legendexcludelayer>
  <legendexcludelayer layer="Bathymetry">2</legendexcludelayer>
  <legendexcludelayer layer="Bathymetry">3</legendexcludelayer>
  <legendexcludelayer layer="Bathymetry">4</legendexcludelayer>
 </legendexcludelayers>


Where "Bathymetry" is the name of the operational layer that I want to exclude layers from.

Unfortunately the items still appear in my Legend. Any ideas?

Thanks again for another fine widget, by the way.
Karl
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Karl,

  So in your main config.xml you have this right?

<operationallayers>
            <layer label="Bathymetry" .... 

Case sensitive
0 Kudos
KarlWilson
Frequent Contributor
Yes:

<operationallayers>

<layer label="Bathymetry" type="dynamic" visible="true"
                   url="xxx"/>
...


The layer loads fine in the map.
0 Kudos
JeffLegato
Regular Contributor
Robert,

I can confirm that something is different between v2.2.2 and 2.2.1 in using the legendexcludelayer tag.

I have this code working fine in 2.2.1...
<legendexcludelayers>
  <LegendexcludeLayer mapservice="Streets">0</LegendexcludeLayer>
  <LegendexcludeLayer mapservice="Blank">0</LegendexcludeLayer>
  <LegendexcludeLayer mapservice="World Aerial">0</LegendexcludeLayer>
  <LegendexcludeLayer mapservice="World Aerial">1</LegendexcludeLayer>
  <LegendexcludeLayer mapservice="World Aerial">2</LegendexcludeLayer>
  <LegendexcludeLayer mapservice="World Aerial">3</LegendexcludeLayer>
  <LegendexcludeLayer mapservice="USGS Topo">0</LegendexcludeLayer>
 </legendexcludelayers>

However, in 2.2.2 when I use the same code the layers still appear in the legend.  These are all ESRI basemap layers (except "blank").
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Karl & Jeff,

   Sorry for the inconvenience. The issue is simple I forgot to draw attention to a change in the config file that:

<legendexcludelayer mapservice="Streets">0</legendexcludelayer>


legendexcludelayer is now all lower case!
0 Kudos
JeffLegato
Regular Contributor
legendexcludelayer is now all lower case!


That did it!  Thank you! 😄
0 Kudos
KarlWilson
Frequent Contributor
My legendexcludelayer was already lower case, but I noticed in Jeff's post that he used mapservice instead of layer, so I changed

<legendexcludelayer layer="Bathymetry">1</legendexcludelayer>

to
<legendexcludelayer mapservice="Bathymetry">1</legendexcludelayer>

and it now works 🙂
0 Kudos