You are trying to add an object that does not exist. You want to add 'polyGraphic' to the map.
map.graphics.add(polyGraphic);
Also, make sure you have access to your map object within that functional scope.
oops, but anyways that wasn't problem still does same thingand I have full access to the map as well any suggestions? I've tried
function getLocRes(results) {
//map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5]));
var combinedExtent = new esri.geometry.Extent();
for (var i = 0;i < results.features.length; i++) {console.log("i=",i);
var polyGraphic = new esri.Graphic(results.features, symbol);
map.graphics.add(polyGraphic);
console.log("i=",i);
}
combinedExtent = esri.graphicsExtent(results.features);
map.setExtent(combinedExtent, true);
}
function getLocRes(results) {
//map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5]));
var combinedExtent = new esri.geometry.Extent();
for (var i = 0;i < results.features.length; i++) {console.log("i=",i);
var polyGraphic = results.features;
polyGraphic.setSymbol(symbol);
map.graphics.add(polyGraphic);
console.log("i=",i);
}
combinedExtent = esri.graphicsExtent(results.features);
map.setExtent(combinedExtent, true);
}
both stop at either map.graphics.add(polyGraphic); or map.graphics.clear();Thanks Jon