Austin thanks for the suggestion. I feel like there has to be a more elegant way. I've tried the following but I am not able to get the points to show on the map and so I don't know if my info popup will work this way. I get results in the feature class in the OnResutls call back but I can't get them to show. The thing that is confusing to me is that there is a input geometry parameter to the REST API that you call but I can't see how to set it the same way that you specify the where clause or definitionExpression.
var layerName:String;
if ( configXML )
{
layerName = configXML.layer;
}
else
{
layerName = "Tickets";
}
var ticketLayer:FeatureLayer = map.getLayer(layerName) as FeatureLayer;
var queryTask:QueryTask = new QueryTask(ticketLayer.url);
var queryTickets:Query = new Query();
// geom is the geometry object that the user draws on the map
if ( geom != null )
{
queryTickets.geometry = geom;
queryTickets.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
queryTickets.outSpatialReference = geom.spatialReference;
}
else
{
queryTickets.outSpatialReference = map.spatialReference;
}
var graph:GraphicsLayer = new GraphicsLayer();
graph.name = "testGeo";
map.addLayer(graph);
//ticketLayer.queryFeatures(queryTickets, new AsyncResponder(onResult, onFault));
queryTask.execute(queryTickets, new AsyncResponder(onResult, onFault ));
function onResult(featureSet:FeatureSet, token:XMLList = null):void
{
var tktSym:SimpleMarkerSymbol = new SimpleMarkerSymbol("triangle", 20, 0xFF0000);
graph.symbol = tktSym;
graph.graphicProvider = featureSet.features;
}
function onFault(info:Object, token:Object = null):void
{
}