simon.miles.rbwm

deactivate.doBuffer

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

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
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/util_buffergraphic.html

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

gsvc = new esri.tasks.GeometryService("http://sampleserver1.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer");
      dojo.connect(map, "onClick", doBuffer);

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

function doBuffer(evt) {
      doBuffer.deactivate ();
      map.graphics.clear();
      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

Regards

Simon

Outcomes