Placing the Navigation Toolbar inside a DIV seems to cause problems

609
1
07-19-2011 12:25 PM
brianrathburn
New Contributor
I noticed that if we put a Javascript Navigation Toolbar dojo object inside a div then this messes up the mouse interaction with the Map. For example if you if use the  zoom in functionality the drag box is drawn away from where the mouse is clicked on the map. Is there a way to fix this.
For Example in the snippet below the div corresponding to the Nav toolbar is inside another div with id ???dlgMap???. In this case the drag box does not show up in the correct location when the user uses the zoom in tool on the Map.



<div id="dlgMap" title="Map Window">
        <div id="navToolbar" dojotype="dijit.Toolbar">
            <div dojotype="dijit.form.Button" id="zoomin" iconclass="zoominIcon"                 
                onclick="Globals.NavToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);">
                Zoom In</div>
           
        </div>
        <div id="MapOne">
        </div>
        <asp:Button ID="btnClose" UseSubmitBehavior="false" runat="server" Text="Close" />
</div>


Is there a better way to do this that will not cause problems?


Thanks
Brian
0 Kudos
1 Reply
derekswingley1
Frequent Contributor
The simplest solution is to not put the toolbar inside the map's div. We discussed this recently in another thread:  http://forums.arcgis.com/threads/32706-Pan-arrows

Also, if you only want to zoom in, why not include a note in your app that you can zoom in by holding shift + clicking and dragging a box? If you don't need the other nav toolbar functions, I think that would be the ideal solution.
0 Kudos