Discussion created by simon.miles.rbwm on Feb 17, 2011
Latest reply on Feb 18, 2011 by simon.miles.rbwm

I'm going back to basics and working with a sample. What i'm trying to do and failing is in the first instance is to deactivate the doBuffer function and only activate it when i clicking on a button.

I'm using this esri sample

what i've tried and failed with is removing "dojo.connect(map, "onClick", doBuffer);" from the function initialize...

gsvc = new esri.tasks.GeometryService("");
      dojo.connect(map, "onClick", doBuffer);

adding in doBuffer.deactivate (); in the below funcation....

function doBuffer(evt) {
      doBuffer.deactivate ();;
      var symbol = new esri.symbol.SimpleMarkerSymbol();
      var graphic = new esri.Graphic(evt.mapPoint, symbol);

then in the body adding in a button....

<button type="button" onClick="doBuffer.activate();">Click Me!</button>

But its just not happening, where am i going wrong?

Any help would be great