I have 2 buttons in my application. Identify and Buffer
What I ma after is clicking the identify and then being about to click the map and run it.
Then click the Buffer button and run the Buffer code.
Right now I can hit the Buffer Button and run the buffer code
Then click the identify button (click it) and run the identify code (THE BUFFER CODE DOES NOT RUN)
But if I go back to the Buffer Button and run that code the Identify code is STILL running.
I cant seem to pause the Identify code....Anyone have any thoughts
Just pasting a snip of the code below...can post more if need be.
var action1, action2, action3;
on(dojo.byId('Identify'), "click", Identify);
on(dojo.byId('Buffer'), "click", Buffer);
function Identify() {
if (action2 != undefined) {
action2.pause();
}
if (action1 == undefined) {
action1 = initializeSidebar(app.map);
action3 = mapReady();
featureLayer.setInfoTemplate(template);
}
else {
action1.resume();
}
}
function Buffer() {
if (action1 != undefined) {
action1.pause();
action1.destroy();
action3.pause();
action3.destroy();
}
if (action2 == undefined) {
action2 = on.pausable(app.map, "click", function(evt) {
var params = new BufferParameters();
params.geometries = [ evt.mapPoint ];
params.distances = [ 2 ];
params.outSpatialReference = app.map.spatialReference;
params.unit = GeometryService.UNIT_STATUTE_MILE;
BufferTool(map, params); // Call BufferTool function and pass the Buffer Parameters
});
}
else {
action2.resume();
}
}