Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all articles
Browse latest Browse all 2097

Add identify button to navigation widget

$
0
0
All,

I am trying to add an icon to the navigation widget that opens up the identify widget, i.e:

Attachment 20812

I have managed to do this by adding the following to the navigation.mxml:

in the array collection for the images added:
Code:

<s:ArrayCollection>
<fx:Object action="pan" imageIcon="assets/images/i_pan.png" label="{LocalizationUtil.getDefaultString('panLabel')}"/>
<fx:Object action="zoomin" imageIcon="assets/images/i_zoomin.png" label="{LocalizationUtil.getDefaultString('zoomInLabel')}" visible="false"/>
<fx:Object action="zoomout" imageIcon="assets/images/i_zoomout.png" label="{LocalizationUtil.getDefaultString('zoomOutLabel')}"/>
<fx:Object action="identify" imageIcon="assets/images/i_identify.png" label="Identify" />
</s:ArrayCollection>

and then changed the doNavAction function to the following:

Code:

private function doNavAction(action:String, label:String):void
{
  var data:Object =
  {
      tool: action,
      status: label
  }
  if(data.tool == "identify")
  {
      AppEvent.dispatch(AppEvent.WIDGET_RUN, ViewerContainer.getInstance().widgetManager.getWidgetId("Identify"));
      AppEvent.dispatch(AppEvent.SET_MAP_NAVIGATION, {tool: "Pan",status: "Pan"});
  }
  else
  {
  AppEvent.dispatch(AppEvent.SET_MAP_NAVIGATION, data);
  }
}

This opens up the identify widget as expected and sets the map navigation back to pan, but unfortunatly it does not change the selected icon to the pan icon, how can I represent a mouse click on the pan icon using code,

Regards

Anthony
Attached Thumbnails
Click image for larger version

Name:	navbar.png‎
Views:	N/A
Size:	34.1 KB
ID:	20812  

Viewing all articles
Browse latest Browse all 2097

Trending Articles