function doBuffer(evt) { var globals = dojo.disconnect(map, "onClick", doBuffer); ... } <button type="button" onClickConnect = dojo.connect(map, "onClick", doBuffer);>Click [/SIZE]
<input type="button" onclick="globals = dojo.connect(map, 'onClick', doBuffer); " value="Click Me!">
function doBuffer(evt) { dojo.disconnect(globals); ... }
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.htmlwhat 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 greatRegardsSimon
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.