Select to view content in your preferred language

GeometryService.buffer error

2452
2
Jump to solution
02-25-2016 11:41 AM
TyroneBiggums
Deactivated User

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?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tyrone,

  The issue I see it that distances is expecting an array not  a number:

params.distances = [$('#inputBufferRadius').val()]; // returns 5

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Tyrone,

  The issue I see it that distances is expecting an array not  a number:

params.distances = [$('#inputBufferRadius').val()]; // returns 5

TyroneBiggums
Deactivated User

Dude! Good eye. Thank you.

0 Kudos