I think you are correct Mattias. Using the identifyTask will do the trick as long as you have all your layers in one service. Combine multiple services (WebmapServers, WMS, WFS) in to one identifier task would have been great. Something for 3.1?In addition to setting your buffered line as geometry in the identifyparameters you also need to set the layeroptions to "all". Something like his://Executes when drawing is completed assuming you draw your line
private function drawEnd(event:DrawEvent):void
{
var geom:Geometry = event.graphic.geometry;
identifyParameters.returnGeometry = true;
identifyParameters.tolerance = 3;
identifyParameters.width = map.width;
identifyParameters.height = map.height;
identifyParameters.layerOption = "all";
identifyParameters.mapExtent = map.extent;
identifyTask.showBusyCursor = true;
//Bufferering drawing
var bufferParameters:BufferParameters = new BufferParameters();
bufferParameters.geometries = [ geom ];
bufferParameters.distances = [ <your buffer distance value> ];
bufferParameters.unit = GeometryService.UNIT_METER;
bufferParameters.outSpatialReference = map.spatialReference;
bufferParameters.unionResults = true;
geometryService.addEventListener(GeometryServiceEvent.BUFFER_COMPLETE, bufferCompleteHandler1);
geometryService.buffer(bufferParameters);
function bufferCompleteHandler1(event:GeometryServiceEvent):void
{
for each (var polygon:Polygon in event.result)
{
geometryService.removeEventListener(GeometryServiceEvent.BUFFER_COMPLETE, bufferCompleteHandler1);
identifyParameters.geometry = polygon;
identifyTaskIntresseletaren.execute(identifyParameters)
break;
}
}
}
<esri:GeometryService id="geometryService" url="<your geometry service> "/>
<esri:IdentifyParameters id="identifyParameters"/>
<esri:IdentifyTask id="identifyTask"
concurrency="last"
showBusyCursor="true"
executeComplete="identifyTask_executeCompleteHandler(event)"/>This will work as long as you don't combine your spatial search with a text search.text search - use findtaskspatial search - use identifytasktext and spatial search - use querytask but can only search on one layer and field at a timesearching in one layer only - use querytask, much faster than findtask and identifytaskKarl MVäxjö municipality