I currently have a featurelayer being queried, and the results placed in a graphicslayer ... I am hoping that the results can be placed in a new featurelayer instead?
Here is current code:
$("#radio-4").click(function() { //shows only January crimes
var sr = new SpatialReference(102100);
janResults = new GraphicsLayer();
janResults.title = "January";
map.add(janResults);
var janQuery = featurelayer.createQuery();
janQuery.where = "Month = 'January'";
janQuery.outFields = ["Offense" , "Location"];
janQuery.returnGeometry = true;
janQuery.outSpatialReference = sr;
featurelayer.queryFeatures(janQuery).then(displayGraphics);
function displayGraphics(results) {
janResults.removeAll();
for (feature of results.features) {
var janGraphic = new Graphic ({
geometry: feature.geometry,
symbol: {
type: "simple-marker",
color: "blue",
size: "20px",
outline: {
color:"black",
width: 2,
},
},
});
janResults.add(janGraphic);
}
}
}); //end of January query
Solved! Go to Solution.
Ahh. I did not think about that since you had it in your original code.
Thanks again!