I am trying to add a buffer to a point that I draw on a map. I went with the example shown on this documentation: https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#buffer
My actual code is:
$('#buttonBufferAdd').click(function (e) {
var spatialReference = new SpatialReference(item.Geometry.SpatialReference); returns wkid: 102100
var params = new BufferParameters();
params.geometries = [new Point(item.Geometry.Point.Coordinate.X, item.Geometry.Point.Coordinate.Y, spatialReference)];
params.distances = $('#inputBufferRadius').val(); // returns 5
params.unit = utils.getUnitOfMeasurement(); // returns 9030
params.bufferSpatialReference = spatialReference;
params.outSpatialReference = map.spatialReference;
var geometryService = new GeometryService(geometryService); // url verified
geometryService.buffer(params);
});
I get the following error:
Object doesn't support property or method 'join'.
Why?
Thanks!
p.s. The code block thing crapped out today, please bear with the sloppy code paste.
EDIT:
And should I be using GeometryEngine.buffer instead?
And is there a way to change the buffer color?
Solved! Go to Solution.
Tyrone,
The issue I see it that distances is expecting an array not a number:
params.distances = [$('#inputBufferRadius').val()]; // returns 5
Tyrone,
The issue I see it that distances is expecting an array not a number:
params.distances = [$('#inputBufferRadius').val()]; // returns 5
Dude! Good eye. Thank you.