So I am both new to Javascript and new to this ArcGIS API. I know I'm just missing some sort of basic knowledge so I figured I'd turn to the experts.
I have just came back from not doing any coding for about a year, so things are definitely not fresh. I'm attempting to use the GeometryEngine with the 4.26 API to buffer a radius from a given feature/set of features.
Currently it's saying that the geometry is null (line 9 in the code below), so it isn't seeing any of the features data inside this function. I am sure I had this working at one point. Can anyone tell me how to get the features data accessible from inside this function? (If you need more information about the rest of my code just let me know).
function buffertheSelection(event) {
if (bufferSelection.classList[2] === "button-text") {
var parcel = [];
var dist = [];
dist.push(300);
bufferSelection.classList.remove("button-text");
bufferSelection.classList.add("active");
for (i=0; i < features.length; i++){
parcel.push(features[i].feature.geometry);
}
const ptBuff = geometryEngine.buffer(parcel, dist, "feet", true);
featureTable.clearSelectionFilter();
bufferGraphic = new Graphic ({
geometry: ptBuff[0].extent,
symbol: {
type: "simple-fill",
color: ([153, 255, 255, 0.5])
}
});
bufferGraphic.layer === parcelSearchLayer;
view.graphics.add(bufferGraphic);
featureTable.filterGeometry = ptBuff[0].extent;
} else {
bufferSelection.classList.remove("active");
bufferSelection.classList.add("button-text");
view.graphics.remove(bufferGraphic);
}
}
Thanks for taking a look!