Select to view content in your preferred language

Flex Viewer 2.2+ Nav Widget in 2.0 application?

1181
5
10-26-2011 09:00 AM
dmacq
by
Occasional Contributor
I'm working on a Flex Viewer 2.0 based application that was rolled out before I started.  I'd like to remove the navigation tools from the banner and implement the navigation widget that is currently being used in Flex Viewer 2.2 and up.

I've tried implementing the new version of the Widget Manager and such, but I'm realizing that I'm in over my head.  Any help would be appreciated.
Tags (2)
0 Kudos
5 Replies
dmacq
by
Occasional Contributor
I bailed on adding the navigation tool as a widget, and went with a simpler solution. I implemented Navigation.MXML using this thread as a guide of sorts.

My only problem now is, I can't get the zoom in/out and pan icons to show.  I've tried everything, to no avail.  I'm thinking it has something to do with the IconButtonSkin, but nothing I've done to the skin has helped.  I'm so close, I'd appreciate any advice on this.

Below is the code for the button bar.  I've tried imageIcon, icon, etc.

  <s:ButtonBar id="btnBar"
      change="buttonbar1_changeHandler(event)"
      requireSelection="true"
      selectedIndex="0"
      skinClass="com.Widgets.ESRI.Navigation.VerticalButtonBarSkin"    
      valueCommit="buttonbar1_valueCommitHandler(event)">
   <s:layout>
    <s:VerticalLayout gap="0"/>
   </s:layout>
   <s:dataProvider>
    <s:ArrayCollection>
     <fx:Object action="pan"
          icon="com/Assets/ESRI/images/icons/i_pan.png"
          id="pan"
          label="Pan"/>
     <fx:Object action="zoomin"
          id="zoomIn"
          label="Zoom In"        
          icon="{zoomIcon}">
     <fx:Object action="zoomout"
          id="zoomOut"
          icon="com/Assets/ESRI/images/icons/i_zoomout.png"           
          label="Zoom Out"/>
    </s:ArrayCollection>
   </s:dataProvider>
  </s:ButtonBar>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
dmacq
by
Occasional Contributor
Robert, I appreciate the response, but I'm using version 2.0 of the viewer.  I used the thread I linked above to implement the NavMenu successfully.  However, what I want to use is the newer Navigation tool that's being used in 2.2 and up.  I've been able to get it loaded by adding it to index.mxml, and everything is working. The exception being the icons and labels for the pan and zoom in/out tools.  It should be so simple, but I can't figure it out.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Drew,

  I don't have the time to go back into Flex 3 and dig up a Flex Viewer 2.0 project.

I did also make the navigation widget work in non flex viewer applications. You might be able to get something working form that code.

http://forums.arcgis.com/threads/24250-Something-I-m-still-a-little-confused-about...?highlight=navi...
0 Kudos
dmacq
by
Occasional Contributor
Robert, thanks for your willingness to help.  I figured out the problem, there was some code missing in IconButtonSkin.

If anybody is interested in doing something similar, I'm happy to share the code.
0 Kudos