Another Enhanced TOC/Legend Widget

3144
37
03-28-2011 01:05 AM
ZillaPlace
New Contributor
Hi guys,

I don't like an idea of separating TOC and legend. Maybe I am an old-fashion guy, but I like to have a widget where I could see icons and names, turn on/off layers, tell whether or not a layer is in its display scale range. And it has to handle sublayers because I have a lot of layers with subtypes. It would be cool if I could click a layer and see the layer properties. It doesn't have to show all of them, but just some major pieces. You know, something like the TOC in ArcMap.

And some of my friends are still using 9.3.1 and others have gone to 10. The widget should work for all of them, although I wouldn't mind telling them that it runs faster and more smoothly with 10. The widget should load the legend for a meshup of services hosted on either 10 or 9.3.1.

If you were like me, take a look at this widget. You may like it. It's a beta version developed on FlexViewer 2.2.
Tags (2)
0 Kudos
37 Replies
RobertScheitlin__GISP
MVP Emeritus
Zilla,

    A live preview site sure would be nice and it really help people see if it is a widget that they are really interested in.
0 Kudos
ZillaPlace
New Contributor
Zilla,

    A live preview site sure would be nice and it really help people see if it is a widget that they are really interested in.


Thanks Robert. That's actually on my to-do list 🙂

BTW, what do you think about the widget? I have added a few new features and fixed some bugs since last post.

Revision: 3-27-2011
1. added labels into config.xml
2. added displayMode into config.xml for a collapsed or expanded mode (thanks ryonwithano for the great suggestion)
3. added buttons to expand or collapse all layers
4. added search layers by keyword

Revision: 3-29-2011
1. improved the error handling
2. added the support for a tiled map service
3. fixed the layers ordering bug (thanks webmapper123 for reporting the bug)
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Zilla,

   I like it. This is always what I was after with my TOC widget but the capability was just not there with Server until now. This are just some of my comments and suggestions:

  1. Use a plus and minus icon for expanding groups like ArcMap does.

  2. I see you included my sd_overlay.png why did you choose to just gray out the scale dependant item instead of using it?

  3. There is a white halo on all the legend swatches. What type of PNG are you using?

  4. If you change the properties PNG from the blue ellipses image to black and 50 to 80% transparency it would work better with other theme colors. The blue clashes with some of the other themes.

  5. The properties state gets clipped most of the time with the widget at default size. You may want to put a scroller in that group.

  6. The titlebar buttons are not reflecting the state change from legend to properties state.

This is by far still the best widget out there for combining Legend TOC and MORE. Great job!
0 Kudos
ZillaPlace
New Contributor
Robert, Thank you for comments and suggestions.

I have been focusing on the functionality so far. There are a lot of cleanup and styling work to do.

1. I intend to leave icons to users, since everyone has his/her preference about the look and feel. Personally, I am sort of quirky enough to like the globe things better than the plus/minus icons.  I know a lot of people would agree with you.

2. You are right. I didn't use your sd_overlay. No offense. When I looked at your widget (Great Work!), I think an out-of-scale icon was kind of hard to see. For me, it is easier to notice the labels going gray.

3. It is png32.

4. I will try what you suggested.

5/6. I will fix them. 

Thanks again!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Zilla,

   So does this mean you will be releasing the code?
I intend to leave icons to users, since everyone has his/her preference about the look and feel. Personally, I am sort of quirky enough to like the globe things better than the plus/minus icons. I know a lot of people would agree with you.
I really like the widget but I don't have any need for the properties page and prefer my alpha slider setup, and the plus and minus icons 🙂
0 Kudos
LeeAllen
Occasional Contributor
I looks like there are multiple requests on the widget comments to please release code, me being one of them.  This is a great widget, and I really want to implement!!

I have another request/improvement:  Since you now have the symbol and layer name showing up together, is it possible to have the symbol to the left of the layer name instead of below?  This would save much needed space and excessive scrolling.  I have seen this in javascript, picture example is below.

[ATTACH=CONFIG]5691[/ATTACH]
0 Kudos
ErwanCaradec
New Contributor II
Hello Plaizilla, this is a great job ! I'm very interested using your widget.

-That's ok now, i'm seeing my v10 operational layers without error popup.
-"The last version is able to handle tiled services", is there a way to configure the widget to do it ? I don't see my tiled services (v10).
-could you please set all the text labels to be configurable in the Legend2Widget.xml ?
- does the widget only use the color style of the application ? the fields list would need more contrast or different color (see the picture in attachment)
- A problem with the TOC checkboxes : when a check box in front of a layer group or a layer is defauld checked, when it is unchecked the layer or group layer stay visible. It doesn't work until the service's check box is unchecked and re-checked.
- A little problem with the icons, when the 3 points icon i used to switch the property view, the selected icon on the top right doesn't switch.
- Like Robert, i'd prefer plus & minus icons too.

Thanks,

Erwan
0 Kudos
ZillaPlace
New Contributor
I looks like there are multiple requests on the widget comments to please release code, me being one of them.  This is a great widget, and I really want to implement!!

I have another request/improvement:  Since you now have the symbol and layer name showing up together, is it possible to have the symbol to the left of the layer name instead of below?  This would save much needed space and excessive scrolling.  I have seen this in javascript, picture example is below.

[ATTACH=CONFIG]5691[/ATTACH]


The widget does have the icon and name of each layer on the same row (as showed in the widget thumbnail). Please let me know if you see anything different.
0 Kudos
ZillaPlace
New Contributor
Thanks Erwan. I will work on fixing those bugs.

-That's ok now, i'm seeing my v10 operational layers without error popup.
Great!
-"The last version is able to handle tiled services", is there a way to configure the widget to do it ? I don't see my tiled services (v10).
If you add a tiled service into the operationalLayers tag, the widget will generate a legend. However, the widget does ignore any basemap layer.
-could you please set all the text labels to be configurable in the Legend2Widget.xml ?
fixed in Revision 4-4-2011
- does the widget only use the color style of the application ? the fields list would need more contrast or different color (see the picture in attachment)
Yes it only uses the app color style. I agree the field list needs a better style.
- A problem with the TOC checkboxes : when a check box in front of a layer group or a layer is defauld checked, when it is unchecked the layer or group layer stay visible. It doesn't work until the service's check box is unchecked and re-checked.
Let me look into this.
- A little problem with the icons, when the 3 points icon i used to switch the property view, the selected icon on the top right doesn't switch.
fixed in Revision 4-4-2011
- Like Robert, i'd prefer plus & minus icons too.
Please feel free to modify the icons (i_xxx_collapsed.png and i_xxx_expanded) or any other icon.
0 Kudos