function showResults(results) {//This bounds the results into the data grid from doFind() function var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([98,194,204]), 200), new dojo.Color([98,194,204,0.5])); for(var i=0; i < results.features.length; i++){ //map.graphics.add(results.features); var graphic = results.features; graphic.setSymbol(symbol); map.graphics.add(graphic); } } Solved! Go to Solution.
query.outSpatialReference = map.spatialReference;
query.outSpatialReference = map.spatialReference;
var qTask= new QueryTask(queryTaskUrl);
var query = new Query();
query.returnGeometry = true;
query.maxAllowableOffset = 4326;
query.where = executableQuery;
query.spatialRelationship = Query.SPATIAL_REL_CONTAINS;
var spRef = new esri.SpatialReference({
wkid: 102100
});
query.outSpatialReference = spRefvar spRef = new esri.SpatialReference({
wkid: 102100
});
var queryRequest = esriRequest({
url : queryTaskUrl,
content : {
f : "json",
returnGeometry: true,
where : executableQuery,
outSR:spRef ,
maxAllowableOffset:4326,
spatialRel:"esriSpatialRelContains"
},
callbackParamName : "callback"
}, {usePost : true});
handleAs : "json",
queryRequest.then(showResults, function (error) {
console.log("Error: ", error.message);
});
var color="#919191";
try {
var symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color("#AED8EC"), 1), new Color(color));
dojo.forEach(featureSet.features, function(feature){
console.log(" iterating each feaures " +feature);
//var graphic = new FeatureSet(feature);
var graphic=new FeatureSet(feature);
//var graph = new Graphic(graphic);
graphic.setSymbol(symbol );
console.log(" graphic feaures " +graphic.symbol.color);
console.log(" graphic visible " +graphic.visible);
map.graphics.add(graphic);
});
}
catch (e) {
console.log(" issue in iterator " + e);
}outSR:map.spatialReference
Sorry my code is not solution to ur problem , i have same problem as yours .But for your problem check from desktop tool the projection sysrtem and spatialrefrence to use.