string json = "{\"hasM\":true,\"paths\":[[[-4,1,1],[-4,3,2],[-2,3,3],[-2,5,1]],[[3,5,1],[3,2,2],[6,2,3],[6,-2,2]]]}";
Polyline polyline = PolylineBuilderEx.FromJson(json);
// Get the distances as length measured from the start of the multipart
IReadOnlyList<double> distances = GeometryEngine.Instance.GetDistancesAtM(polyline, AsRatioOrLength.AsLength, 2);
// distances.Count = 4
// distances[0] = 2 measured to the point (-4, 3, 2)
// distances[1] = 5 measured to the point (-2, 4, 2). Its M-value is interpolated from the segment (-2, 3, 3) -> (-2, 5, 1)
// distances[2] = 9 measured to the point (3, 2, 2)
// distances[3] = 16 measured to the point (6, -2, 2)
// Get the distances as a ratio of the distance measured from the start of the multipart and the total length of the multipart
distances = GeometryEngine.Instance.GetDistancesAtM(polyline, AsRatioOrLength.AsRatio, 2);
// distances.Count = 4;
// distances are { 0.125, 0.3125, 0.5625, 1 }