The problem appears to be related to how Dojo is interpreting objects passed as parameters from one script to another, or in a callback. A center point graphic and a radius get passed to a function after a user enters a map point. Then for some reason, the buffer parameters object doesn't recognize either the graphic or its geometry as valid objects.I've been able to make this work by changing the script to explicitly create the geometry from the input object:
function getCircleFromPoint(centerPointGraphic, radius)
{
var geometryService = new esri.tasks.GeometryService(_thisMap.GeometryServiceUrl);
var point = new esri.geometry.Point(centerPointGraphic.geometry.x,
centerPointGraphic.geometry.y,
new esri.SpatialReference({ wkid: 4326 })
);
var params = new esri.tasks.BufferParameters();
params.geometries = [point];
params.distances = [new Number(radius)];
params.unit = esri.tasks.GeometryService.UNIT_STATUTE_MILE;
params.bufferSpatialReference = new esri.SpatialReference({ wkid: 4326 });
params.outSpatialReference = map.spatialReference;
var obj = this;
dojo.connect(geometryService, "onBufferComplete", obj, "geometryBufferCompleteCallback");
geometryService.buffer(params);
}
The same problem prevented a QueryTask from executing with the circle produced by the buffer call. The solution there was to create a new Polygon and loop through the circle's rings, adding them to the new Polygon's rings and using the new Polygon in the query task.