Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

122361
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
Scott_Russell
Regular Contributor
Robert,

Is it possible to 'hide' or 'disable' specific layers within a service on this table of contents?  I'm guessing that it looks at the service as a whole and if I have a dynamic map service containing all my layers I may be out of luck.

Thanks,
Scott
0 Kudos
RhettZufelt
MVP Notable Contributor
Robert,

Is it possible to 'hide' or 'disable' specific layers within a service on this table of contents?  I'm guessing that it looks at the service as a whole and if I have a dynamic map service containing all my layers I may be out of luck.

Thanks,
Scott


Scott,

The TOC widget supports
 <excludelayers>
  <excludelayer mapservice="Symbols"></excludelayer>
  <excludelayer mapservice="Utilities">8</excludelayer>
 </excludelayers>


the first example excludes entire service, the second only excludes sub-layer 8

R_

this is straight out of the example.xml that comes with the widget.  Some documentation on it in the readme as well.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   It is possible to exclude a specific layer from a map service which (Removes it from the map as well), this is all that is currently possible.
<excludelayer mapservice="Utilities">8</excludelayer>
Where 8 is the layer id (meaning the ninth layer of this service).
0 Kudos
RhettZufelt
MVP Notable Contributor
Scott,

   It is possible to exclude a specific layer from a map service which (Removes it from the map as well), this is all that is currently possible.
<excludelayer mapservice="Utilities">8</excludelayer>
Where 8 is the layer id (meaning the ninth layer of this service).


Robert,

if I load a layer such as
<layer label="Hanford Wells" type="dynamic" visible="true" alpha="1"
      url="http://host/ArcGIS/rest/services/Base/wells/MapServer">
      <sublayer id="1" popupconfig="popups/PopUp_wells.xml"/>
      <sublayer id="0" popupconfig="popups/PopUp_Inject.xml"/>
   </layer>


it will be turned on when the map loads.

In the TOC.xml I put
 <excludelayer mapservice="Hanford Wells"></excludelayer>
then the layer does NOT show up on the TOC, but it will draw both sub-layers on the map.
If I change it to
<excludelayer mapservice="Hanford Wells">1</excludelayer>
then the sub-layer does NOT show up in the TOC and will NOT draw that sub-layer.

So, it only removes it from the map if a sub-layer is set in the excludelayer tag.  Just curious if this is by design or if mine is behaving differently than expected.
I actually like it this way as I do load some layers that I need to identify against, but don't want them visible or in the TOC. Actually wish the sub-layers behaved this way as well.

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   I should have clarified more...
It is possible to exclude a specific layer from a map service which  (Removes it from the map as well), this is all that is currently  possible.
When you specify the whole map service in the exclude and do not specify any sublayers then the map service will remain in the map. The ReadMe.txt covers this.
0 Kudos
MeiLingFreeman
Emerging Contributor
Hi Robert,

Thanks for sharing the widget.  I have recently downloaded it and like it a lot.  I ran into a few issues and hope you can help me out:

1: how to change the checkbox color from white to something else?
2: I was able to change the background color, layer's text color, and the rollover color, but I can't figure it out how to change the highlight color once you click on a layer's name. It is still showing black highlight with white text. see attached image.
3: also I can't figure out how to change the grey text color when a layer is not active because it's outside the zoom scale.

[ATTACH=CONFIG]18675[/ATTACH]

Many thanks in advance!
0 Kudos
MaximilianoPeñaloza_Reyes
New Contributor
Hello Robert,

I'm trying the last version of widget and looking at online preview I can't see any option to zoom on right click menu. I've added uncompiled version to my viewer and this happend too.

Only line that I tried to modified was this:

<disablezoomtomenuoption>true</disablezoomtomenuoption>


Setting it to false. But this doesn't work.

What could I do to solve this?

Thank you in advance.

Best regards.
0 Kudos
SimonHenderson
Deactivated User
G'day Robert, long time lurker, first time poster.

I'm having an issue with my TOC widget when used in conjunction with my Identify widget (both v3 compiled versions).

I'm using the <identifylayeroption>visible</identifylayeroption> option for my identify tool and it is only returning results on the layers that turn on by default. Any layer that I turn on afterwards doesn't seem to return any results.

- I have an identical widget with the identifylayeroption set to all and that picks up everything (so it isn't as if i've mistyped a field name).
-In the mapswitcher widget I have  set the layerlist visible to false. I also went right ahead and disabled the mapswitcher right out of the config file too, as I don't need it.
- I switched back to the layer list widget and tried my identify (visible features) widget and it worked.

If click the layers on and off in the TOC widget, I can see them turning on and off on my map, but it seems that the identify tool thinks that they aren't visible.

Do you have any ideas? Going back to the layer list isn't going to be a big deal, but I do like the feature of the TOC where you can turn off a Sub Layer.

Anyway, cheers in advance.

Simon.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Simon,

    Are you using the latest versions on both widgets?... I just added both IdentifyWidget and TOCWidget to a viewer and they are working fine (i.e. when a layer is off it does not identify and when I turn it on in the TOC it does identify).
0 Kudos
NickG
by
Emerging Contributor
Keith,

   Currently the TOC Widget does not update to programmatic layer visiblilty changes. When  ever I get this figured out an updated version will be released.


Hi Robert,
Any luck with this?  If not could you possibly point me in the general direction (files, approach etc...)?  One thing i've tried that works is to reinitialize the entire toc, but that is not a good approach.  I'm just looking for a simple (yeah right) way to update the checkboxes when layer visibility is altered outside of the TOC much like it already does for the top service nodes.   

Thank you for all of your contributions.

EDIT:  I'm using the most recent version for the 3.0 viewer with AGS 10.1.
0 Kudos