Hello,
I've take the code from here :
ArcGIS API for JavaScript Sandbox
And i've added this code
var lengthParamsCliped = new LengthsParameters();
lengthParamsCliped.calculationType = 'geodesic';
lengthParamsCliped.geodesic = true;
lengthParamsCliped.lengthUnit = 'METER';
lengthParamsCliped.polylines = [polyline];
geometryService.lengths(lengthParamsCliped).then(calculatedClippedLength);
function calculatedClippedLength(res)
{
console.info(res);
}
The code stop with the message "a.toJSON is not a function"
Where a is the polyline who looks like that:
- paths: Array(3)
- 0: Array(2)
- 0: -111.3
- 1: 52.68
- length: 2
- __proto__: Array(0)
- 1: Array(2)
- 0: -98
- 1: 49.5
- length: 2
- __proto__: Array(0)
- 2: Array(2)
- 0: -93.94
- 1: 29.89
- length: 2
- __proto__: Array(0)
- length: 3
- __proto__: Array(0)
- spatialReference:
- wkid: 4326
- __proto__: Object
- type: "polyline"
- __proto__: Object
I will be grateful if someone could help me to find a solution.
Thanks in advance
Best regards
RN
#geometryService
#lengths()
#4.8
#4.x
#a.toJSON