Select to view content in your preferred language

Navigation Tool Decoupled from the Flex Viewer and DrawTool

1262
7
08-06-2012 01:18 PM
ionarawilson1
Deactivated User
I downloaded the navigation tool decoupled from the flex viewer by Rober Sheitlin and it looks great on my application. However I have a draw tool and when I draw a polygon after I click on the zoom in button it creates a red boundary around the polygon and zooms in usually to another area. How can I deactivate the navigation toolbar (especially the zoom in, zoom out tools) when I am using a drawing tool? I have tried everything I could and nothing works. Please help!

Thank you!

Here is the link to the thread I downloaded the file (I used the version for the 2.3 API)

http://forums.arcgis.com/threads/24250-Something-I-m-still-a-little-confused-about
Tags (2)
0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus
Ionara,

   I have not play with that in a very long time but it should be as simple as you setting the NavigationWidget map attribute to null when you activate your drawtool and back to the map on your tools draw finish.
0 Kudos
ionarawilson1
Deactivated User
Robert, I tried that and it did not work

Here is how my navigation widget is defined in my main app:

<navigation:NavigationWidget  left="12" top="20"  id="navigationwidget"   />

So everytime I activate the drawtool I had

navigationwidget.map = "";

and when I deactivated the drawtool I had


navigationwidget.map = myMap;


But I got this run-time error:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.esri.Navigation::Navigation/changeNavigation()
at com.esri.Navigation::Navigation/doNavAction()
at com.esri.Navigation::Navigation/buttonbar1_valueCommitHandler()
at com.esri.Navigation::Navigation/__btnBar_valueCommit()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at spark.components.supportClasses::ListBase/commitSelection()
at spark.components.supportClasses::ListBase/commitProperties()
at spark.components.supportClasses::ButtonBarBase/commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/validateProperties()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()


Thanks for any help you can provide!
0 Kudos
ionarawilson1
Deactivated User
Now I added the myMap to:

<navigation:NavigationWidget  left="12" top="20"  id="navigationwidget" map="{myMap}"  />


And I get this error when I click on the buttons for the draw tools:


TypeError: Error #1034: Type Coercion failed: cannot convert " " to com.esri.ags.Map.
at one_searchonequery_plusgraphicsearch_onlyfreehand/ClickHandler()
at one_searchonequery_plusgraphicsearch_onlyfreehand/__freehandbutton_click()
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ironara,

   That is because "" is a string and you can not set the map that the navigation widget is expecting to a string you need to set it to a null value...

navigationwidget.map = null;
0 Kudos
ionarawilson1
Deactivated User
Now I get thisrun-time error when I deactivate the drawtool and mouse over the map to go use the zoom tool

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.esri.Navigation::Navigation/map_rollOverHandler()
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ionara,

   And you are sure you set the Navigation widgets map back to an instance of the map as I mentioned in my earlier post, on draw tool deactivate?..
0 Kudos
ionarawilson1
Deactivated User
I believe so. I am attaching the code, do you think you can take a look to make sure I am doing this right?

Thanks
0 Kudos