Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

199360
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
RobertScheitlin__GISP
MVP Emeritus
Dan,

   Dynamic layer Absolutely support scale dependent rendering. It is the individual layer that show the scale dependency though and not the parent map service if it does not have scale dependency set for it.
0 Kudos
DanMiller
Emerging Contributor
Thanks for that info Robert...  I figured it did and it was just a data setting.
0 Kudos
DanMiller
Emerging Contributor
Hi Robert and devs,

Is there a way to add my own jpg/png custom icon to render instead of a dot?  I think older versions of flex viewer allowed us to use the icon=<path to jpg> in the config files for operational layers, but it seems to not be working anymore.

Thanks,
Dan
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dan,

   You can setup a renderer for the layer in the main config.xml. Here is an example:

            <layer label="Renderer Example" type="feature" visible="true"
                   url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2">
                   <simplerenderer>
                           <picturemarkersymbol url="assets/images/i_sun.png" width="30" height="30" angle="3"/>
                   </simplerenderer>
            </layer>
0 Kudos
DanMiller
Emerging Contributor
Dan,

   You can setup a renderer for the layer in the main config.xml. Here is an example:

            <layer label="Renderer Example" type="feature" visible="true"
                   url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2">
                   <simplerenderer>
                           <picturemarkersymbol url="assets/images/i_sun.png" width="30" height="30" angle="3"/>
                   </simplerenderer>
            </layer>


Thanks Robert, that did the trick.  However, is there a way to get the sun icon from your example to also render in the TOC Widget as a sun icon (versus the traffic cam icon)?  Additionally I'm using your Dynamic Legend as well so that would cool to know since I print out maps with the D.Legend - it's also showing up as the original Traffic Cam icon there as well.  In a nutshell, unfortunately I don't have the option of changing the icon at the data level so this would be amazing.

I have the uncompiled 3.1 code as well and am messing around but have been unsuccessful so far.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dan,

   The only way I can think of right now is if you have a 10.1 ArcGIS Server and use code like in this sample to change the map service layer renderer at the server:

http://resources.arcgis.com/en/help/flex-api/samples/01nq/01nq00000072000000.htm
0 Kudos
GISDev1
Deactivated User
Hey Robert, I finally got the Identity Manager token the work with your TOC widget, along with any tokens provided in the config.xml which you have added already. I had to modify the ViewerContainer and made a custom sign in window in order to do it though, along with changed to the TOC widget source code.
I don't think the Esri Flex API v3.1 stores the generated token from the Identity Manager anywhere, so I stored it myself which is why all the other changes were necessary.

Would you like me to share my code with you, or are you figuring out a way to do it without modifying all the other things?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
GIS Dev,

  I have a Beta version right now that does all of it in the widget. This link is to the compiled widget, but if you want to test it out I would appreciate and input.

http://forums.arcgis.com/threads/75331-Legend-Widget-not-Refreshing?p=267156&viewfull=1#post267156
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
GIS Dev,

   I also re-wrote a lot of the toc/tocClasses and have the renderer using spark components instead of mx. I have the github site up to date with the 3.1.3 version. I will add the 3.1.4 version in a minute so you can see the IdentityManager stuff.
0 Kudos
KevinThomas
Emerging Contributor
Hi Robert,
First let me thank you for all your great widgets! 

I just got the 3.1 version of this and Group Layers don't seem to be working...  You can see them in the TOC but the checkboxes do not work.  This is true for me even in your sample.  Once I uncheck the Symbols >> symbols.SDE.Labels I am not able to check it again...

thanks again,
Kevin
0 Kudos