As always - You the man!!
Robert can you please provide your favorite lunch place in your town, I'll get you a gift certificate or have it delivered!!
I added:
import com.esri.ags.geometry.Extent;
And then swapped out the original searchDrawEnd with Robert's code below:
private function searchDrawEnd(event:DrawEvent):void
{
var geom:Geometry = event.graphic.geometry;
if(geom.type == Geometry.MAPPOINT)
{
//Expand the point by 5 pixels
var point:MapPoint = geom as MapPoint;
var xMin:Number = map.toScreen(point).x - 2.5;
var yMin:Number = map.toScreen(point).y - 2.5;
var xMax:Number = map.toScreen(point).x + 2.5;
var yMax:Number = map.toScreen(point).y + 2.5;
var mp1:MapPoint = map.toMap(new Point(xMin,yMin));
var mp2:MapPoint = map.toMap(new Point(xMax,yMax));
var ext:Extent = new Extent(mp1.x, mp1.y, mp2.x, mp2.y);
var pA:Array = [];
var pPoly:Polygon = new Polygon(null,geom.spatialReference);
pA.push(new MapPoint(ext.xmin,ext.ymin,geom.spatialReference));
pA.push(new MapPoint(ext.xmin,ext.ymax,geom.spatialReference));
pA.push(new MapPoint(ext.xmax,ext.ymax,geom.spatialReference));
pA.push(new MapPoint(ext.xmax,ext.ymin,geom.spatialReference));
pA.push(new MapPoint(ext.xmin,ext.ymin,geom.spatialReference));
pPoly.addRing(pA);
queryFeaturesGraphical(pPoly);
} else {
queryFeaturesGraphical(geom);
}
}