polyline.closestPointLength(point)

Return the length of the polyline up to the point that lies closest to point.

If the polyline contains no points, null is returned.