I'm trying to create a polygon that shows the extent of a series of points. I have a series of addresses and can get back the centroids for the points. All I really want is a polygon that represents the area of those points (technically plus a small buffer). Then I want to add that polygon to the view, but not add the points. I can add the points ok and the constructed polygon looks ok as far as it's object properties, but it just won't show up on the view. Anyone have any ideas what I'm doing wrong here? (code below)
var points = [];
for(let i=0;i<results.features.length;i++){
points.push(results.features[i].geometry.centroid);
}
var polylineSymbol = {
type: "simple-line", // autocasts as SimpleLineSymbol()
color: [226, 119, 40],
width: 4
};
var areaPolygon = new Polygon();
areaPolygon.addRing(points);
var polylineGraphic = new Graphic({
geometry: areaPolygon,
symbol: polylineSymbol,
});
App.policyView.graphics.add(polylineGraphic);