deactivate Zoom tool from navToolbar

665
2
Jump to solution
06-03-2014 08:45 AM
jaykapalczynski
Frequent Contributor
I am using the NavToolbar example for a zoom tool....
I can select the zoom tool and zoom in fine...and then hit the deactivate tool and it deactivates the zoom .

But I want the Zoom to deactivate after each usage...I cant put the "navToolbar.deactivate();" in the Zoom function  or it will not run...
Anyone know how I can accomplish turning off the Zoom function after each usage?
Or is there an easier way to do this?

<div id="navToolbar" data-dojo-type="dijit/Toolbar">  <div data-dojo-type="dijit/form/Button" id="zoomin"  data-dojo-props="iconClass:'zoominIcon'"></div> </div> <div id="navToolbar2" data-dojo-type="dijit/Toolbar">          <div data-dojo-type="dijit/form/Button" id="deactivate" data-dojo-props="iconClass:'deactivateIcon'">Deactivate</div> </div>


  var navToolbar = new Navigation(app.map);    registry.byId("zoomin").on("click", function () {     navToolbar.activate(Navigation.ZOOM_IN);   });   registry.byId("deactivate").on("click", function () {     //ClearGraphicsZoomTools();        navToolbar.deactivate();  });
0 Kudos
1 Solution

Accepted Solutions
JeffPace
MVP Alum
First, i think you need to slow down on making new threads.  You can't just make a thread for dozens of issues.  Sometimes, the struggle is the journey

Second

map.on('zoom-end', function(point, extent, level, zoomfactor){
navToolbar.deactivate();
})

View solution in original post

0 Kudos
2 Replies
jaykapalczynski
Frequent Contributor
Any idea how to get a zoom tool to run once and deactivate until clicked again?
0 Kudos
JeffPace
MVP Alum
First, i think you need to slow down on making new threads.  You can't just make a thread for dozens of issues.  Sometimes, the struggle is the journey

Second

map.on('zoom-end', function(point, extent, level, zoomfactor){
navToolbar.deactivate();
})
0 Kudos