I'm attempting to create a buffer option on my map that will take any number of features, buffer all parcels within 300 feet of the parcels selected, and then show the results in a FeatureTable, as well as highlight those features within the radii on my map.
I have the buffer working for a single feature, and have it filtering the geometry to the FeatureTable, but I can't quite figure out how to get it working with an array. I also can't figure out how to highlight the returned features on the map.
Here is my code so far:
function buffertheSelection(event) {
var parcel = [];
var dist = [];
dist.push(300);
for (i=0; i < features.length; i++){
parcel.push(features[i].feature.geometry);
}
const ptBuff = geometryEngine.buffer(parcel, dist, "feet");
featureTable.clearSelectionFilter();
for (i=0; i < ptBuff.length; i++){
featureTable.filterGeometry = ptBuff[i].extent;
}
}
Solved! Go to Solution.
One of the options for the geometryEngine buffer is unionResults
This will return a single buffer geometry for all the geometries buffered and you can use that in the filter.
Hi there,
Have you seen this sample: https://developers.arcgis.com/javascript/latest/sample-code/highlight-features-by-geometry/? Sounds like you are doing what this sample shows.
One of the options for the geometryEngine buffer is unionResults
This will return a single buffer geometry for all the geometries buffered and you can use that in the filter.
Thank you so much.