Select to view content in your preferred language

Table of Contents - Legend Widget for FlexViewer 2.x

184252
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
philippschnetzer
Frequent Contributor
Robert,

Nice updates!  Can you tell me where I can change the colour value of the Layer name when that layer is not visible?  I am using a white background and cannot see the layer name when its not visible at that scale range.  I know I could use a different widget background colour but would much rather just make the layer name darker.  Thanks!

Phil
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Phillip,

   It is not a simple application of a color to the text I am setting the blend mode for the text in the TocItemRenderer.as

(tocItem.scaledependant) ? label.blendMode = BlendMode.SCREEN : label.blendMode = BlendMode.NORMAL;
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

  I have actually never used the ThematicQueryWidget. I will have a look though.
0 Kudos
philippschnetzer
Frequent Contributor
Robert,

Thanks.  I made some changes to try to change the scale dependent layer text color, like so:
(tocItem.scaledependant) ? label.blendMode = BlendMode.LIGHTEN : label.blendMode = BlendMode.NORMAL;


...also, I commented out the whole line and nothing I change seems to affect the colour.  Is there another spot that is overriding the colour applied?

Or do I need to somehow compile something differently when changing an .as file?

Sorry...
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Phillip,

   That line of code is in there twice once in the set data function and once in the UpdateDisplayList function. It turns out that when I set the label to enable equals false Flex applies a graying to the label and then with my code for adjusting the blend on top of that is just too much for a white background so if you comment or delete the blend code from both functions it looks OK using the white background.
0 Kudos
CharlesHarris
Emerging Contributor
Thanks Robert-

I've also added to some code to render an icon for point based feature data that is configured in the config.xml by the user.  I doubt that this will have any bearing on the interaction with the ThematicQuery widget but thought that I'd throw it out there.  The code that I've added will use an icon who's path is specified in the config file if there is one and then use the symbology from the server if there is not one.


Phillip-

I was having the same problem with the white background.  I was able to get a good contrast by changing only the Blendmode at line 302.  Below is what I've changed my Blendmode settings to.

line 302 - (tocItem.scaledependant) ? label.blendMode = BlendMode.DARKEN : label.blendMode = BlendMode.MULTIPLY

Jeremy
0 Kudos
philippschnetzer
Frequent Contributor
Robert and Jeremy, thank you both!
0 Kudos
TracyArchibald
Regular Contributor
Thanks for the great tool!  it works like a charm!

I'm not much of a ESRI person, so forgive me if I use the wrong terms!

I'm having a problem with the metadata button not displaying on certain layer types.  Basically, unless it's a 'feature' type, there isn't a button.  We have a few 'dynamic' services that we would like use, but then we can't access the meta data.  I'm pretty sure it's something in how the service is being published...  I THINK there's a field we need to fill in somewhere.  I've gone through this thread, learned from others and ensured there's data under File->Map document Properties under Description as well as Right Click on the Layers -> Properties->General  Description field.

We've looked through the source code, and it looks like should work fine...  Any more thoughts?

Thanks everyone!
0 Kudos
JacksonTrappett
Frequent Contributor
I've been using this widget for a while now and it works great!  Can't say thank you enough...  Using it has brought up another issue with group layers that I was wondering if you know how to fix Robert (or anyone else).  This is the issue:

Because this widget works like the ArcMap TOC, and doesn't automatically check all of it's child layers when checking a group layer, we have now started using map services where the group layers are turned off when the map loads but the child layers of that group are all on.  This means that when the map loads since the group layer is not checked, nothing displays on the map even though the child layers are checked.  This is exactly how we want it to work.  The difficulty comes in when we start using other processes on the map.

Let's take identify for example.  If I use the identify tool, and tell it to look at layers that are currently on, it shouldn't get the child layers (since their parent is off), but it does.  The catch is, if I interactively toggle one of the group layers on, and then back off in the TOC, and then run the identify, it will not hit the those layers even though they are in the exact same state they were just before I toggled them on and off.

What I'm wondering is if there is a way to initialize the layers, performing the same thing that happens when manually turning something on and back off in the TOC without any user interaction.  It is very confusing for users to be identifying things they don't have turned on, but the alternative of turning everything off by default causes lots of expanding and checking to have to happen when you use grouped layers.
0 Kudos
JacksonTrappett
Frequent Contributor
Came up with a fix for the above problem.  It may not be the best solution but it is working for us for now.  What I did was set any of the processes that hit the dynamic layer in the map to ignore it until after someone clicks one of the layers on in the TOC.  To do this I just dispatched an event from inside the onCheckBoxClick function in TocItemRenderer.as and then listen for it in each of my other widgets that look at the layer controlled by the TOC.  As soon as someone clicks on a check box, the tools will now pay attention to the layer.
0 Kudos