unit: configBufferUnits[cboBufferUnit.selectedIndex].name
unit: "Miles"
function onResult(candidates:Array, token:Object=null):void { var addressCandidate:AddressCandidate; for (var i:int=0; i < candidates.length; i++) { addressCandidate=candidates; if (addressCandidate.score > 80) { var pGeom:Geometry=addressCandidate.location; pGeom.spatialReference=map.spatialReference; var pArray:Array=[addressCandidate.location, addressCandidate.address, addressCandidate.score]; tpoints.push(pArray); } } if (tpoints.length > 0) { qDistrict(); //Your buffering function }
private function bufferGeometries(geomArr:Array, sr:SpatialReference, dist:Array, unit:Number):void { if (geomArr) { showMessage("Buffering...",true); var bufferParameters:BufferParameters = new BufferParameters(); var resultEvent:Polygon = new Polygon; bufferParameters.geometries = geomArr; bufferParameters.bufferSpatialReference = sr; bufferParameters.unit = unit; bufferParameters.distances = dist; bufferParameters.unionResults = dischk.selected; bufferParameters.outSpatialReference = map.spatialReference; geometryService.buffer(bufferParameters,new AsyncResponder(bufferCompleteHandler,bufferFault)); function bufferCompleteHandler(event:Array, token:Object):void { for each(resultEvent in event) { try { var graphic:Graphic = new Graphic(); graphic.geometry = resultEvent; graphic.symbol = sfs; var attribs:Object = { distance: textInputBuffer.text, unit: configBufferUnits[cboBufferUnit.selectedIndex].name } graphic.attributes = attribs; graphicsLayerBuffer.add(graphic); clearMessage(); } catch (error:Error) { showMessage(error.message, false, true); } } } function bufferFault(event:Fault, token:Object):void { showMessage(event.message, false, true); } } }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.