Select to view content in your preferred language

Why does the TOC not scroll horizontally for long Layer names?

1389
7
01-24-2013 06:30 AM
DougBrowning
MVP Esteemed Contributor
Seems like this would be important and in there but it is not.  How would I add this to the code?  Tried wrapping it in the MapSwitcher but no luck.  Thanks
Tags (2)
0 Kudos
7 Replies
DougBrowning
MVP Esteemed Contributor
In my case with the nested layers if I did that it would take up half the screen.  Plus some layer names are really long (I know bad UI but that is how it has to be.) 

It was also be nice that if you hovered the mouse it would show it to you similar to what the windows file browser does.  It would also be nice if MapSwitcher was sizable.

I guess I just keep running into that the viewer is really just for small maps of a few layers.
0 Kudos
RhettZufelt
MVP Notable Contributor
Doug,

The TOC widget seems to add the horizontal bar automatically when it is sized smaller than the list (between the plus sign and dropdown arrow).

I think what you are running into is that the toc box for the list is too small for the length of your layer names and are getting truncated. If you narrow your TOC widget so that you can not see the plus sign and dropdown (where zoom to is), you should see the horizontal scroll bar.

If this is the case, in the TOCWidget.mxml at the bottom, the width of the box being populated is controlled in this part of the code:

<toccomp:TOC id="toc"
  width="100%"
 height="100%"
 labels="{[ZoomToMakeVisible,ExpandAll,CollapseAll]}"
 useesridescription="{UseNewEsriDescrption}"
 expanded="{expanded}"
 disableZoomTo="{disableZoomTo}"
 fullexpanded="{fullexpand}"
 legendCollapsed="{legendCollapsed}"
  liveScrolling="false"
 variableRowHeight="true"
 tocMinWidth="{wTemplate.width - 45}" 
             scroller="{scr}"
  loader="{boxMessage}" paddingTop="0" paddingBottom="0"/>
</s:Group>


If you hard code that to a number that is large enough to fit your layer names (tocMinWidth="500"), then it will push the drop down off the window and thus should add the scroll bar.

R_
0 Kudos
DougBrowning
MVP Esteemed Contributor
I am talking about MapSwitcherWidget which this does not seem to work for. 

Thanks
0 Kudos
KennyHoran
Regular Contributor
I've noticed this as well.  When a nested layer has a long name it gets truncated by the edge of the panel.  One option is to make the panel wider by editing line 434 of MapSwitcherWidget.mxml and changing the width of opLayersContainer from 265 to something larger.

<s:BorderContainer id="opLayersContainer"
                       width="265" height="180"
                       backgroundColor="{getStyle('contentBackgroundColor')}"
                       click="opLayersContainer_clickHandler(event)"
                       includeInLayout="false"
                       keyFocusChange="keyFocusChangeHandler(event)"
                       keyUp="escapeKeyUpHandler(event)"
                       rollOut="startHideTimer()"
                       rollOver="hideOpLayersTimer.reset()"
                       visible="{shouldShowOpLayers}">
0 Kudos
MichaelVolz
Esteemed Contributor
Rhett Zufelt made the MapSwitcher resizeable from the xml file in the post

http://forums.arcgis.com/threads/78093-Resize-More...-widget-in-flexviewer

Would this work for you?  Or does it take up too much of the screen?
0 Kudos
DougBrowning
MVP Esteemed Contributor
I can make it wider no problem.  But I want the scroll instead.  We have long layer names that are also nested in groups a lot of times.  So the combo make it really long sometimes.

Vertical scroll works fine so surprised this was missed.


I might try to find a place to add a data tip function as a partial fix. 

I tried it here in MapSwitcher but it did not work

  <toc:TOC id="toc"
                 left="2" right="2" top="3" bottom="40"
     dataTipFunction="myDataTipFunction"
                 tabIndex="2"/>
0 Kudos
RhettZufelt
MVP Notable Contributor
I just set the layerlistvisible="false" and use the TOC widget.

It automatically puts both scroll bars on there when needed...

R_
0 Kudos