polyline.closestPoint(point)

Return the point on the path that lies closest to point.

If the polyline contains no points, null is returned.