geometryService.buffer with "sqaure ends"?

279
1
Jump to solution
09-04-2019 05:53 AM
JamesCrandall
MVP Frequent Contributor

Hi all,

I'm successfully generating buffered polygons for input polyline features and the requirement has changed to show "square ends" rather than the rounded ends the current buffer is creating.  

Is there a simple parameter I'm missing for the BufferParameters() of a call to the geometryService.Buffer()?

Thanks for any input!

//populate the polyline geometries
var features = layer.featureSet.features;
arrayUtils.forEach(features, lang.hitch(this, function (feature) {
 this.shapeGeometries.push(new Polyline(feature.geometry));
}));

////setup the buffer parameters
var params = new BufferParameters();
params.distances = [buffDist]
params.outSpatialReference = map.spatialReference;
params.bufferSpatialReference = new esri.SpatialReference({ "wkid": "102258" }); //spatial reference info https://spatialreference.org/ref/esri/nad-1983-harn-stateplane-florida-east-fips-0901/
params.unit = GeometryService["UNIT_METER"]; 
params.geometries = this.shapeGeometries;
esriConfig.defaults.geometryService.buffer(params, showBuffer);

//show bufferedGeometries and then continue processing to union them
function showBuffer(bufferedGeometries) {
	 var symbol = new SimpleFillSymbol(
	 SimpleFillSymbol.STYLE_SOLID,
	 new SimpleLineSymbol(
		 SimpleLineSymbol.STYLE_SOLID,
		 new Color([255, 0, 0, 0.65]), 2
	 ),
	 new Color([255, 0, 0, 0.35])
	 );

	 var bFeatures = [];
	 
	 array.forEach(bufferedGeometries, function (geometry) {
		 var graphic = new Graphic(geometry, symbol);			                     
		 bFeatures.push(graphic)			                     
	 });
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

James,

   There is not a square end parameter for buffering, so you are not missing anything.

View solution in original post

1 Reply
RobertScheitlin__GISP
MVP Emeritus

James,

   There is not a square end parameter for buffering, so you are not missing anything.