Solved! Go to Solution.
console.log("My query results:", featureSet.features); //returns an array of your query result's features console.log("My query results:", featureSet.features.length); //returns the length of the feature array
Hi All:
function executeQueryTask()
{
query.where = "CampusName = 'Albany' ";
queryTask.execute(query,showResults);
}
function showResults(featureSet)
{
for(vari=0, i1=resultFeatures.length; i<i1; i++)
{
var graphic=resultFeatures;
graphic.setSymbol(symbol);
graphic.setInfoTEmplate(infoTemplate);
map.graphics.add(graphic);
}
}
});
console.log("My query results:", resultFeatures);
check out your debugger console to see what returned from your query
console.log("My query results:", featureSet.features); //returns an array of your query result's features console.log("My query results:", featureSet.features.length); //returns the length of the feature array
When you use console.log(), that means that you are sending a log message to the console window. So if you are testing your app in the Firefox browser, for example, you should see your log statements in Firebug's console tab, given that you've chosen the Firebug debugger. So for "console.log("My query results:", resultFeatures);" you should see in your debugger console panel the text 'My query reults:' followed by the FeatureSet object that was returned from your query task. You could further drill down and use:
If your debugger does not indicate that any features are getting returned, you should probably check to make sure there is nothing wrong with your feature layer or the way you're writing your query.
for(var i=0, i1=resultFeatures.features.length; i<i1; i++);