Picking the closest point of multiple polylines?

I’ve checked the picker demo on the Sandcastle, but I am not understanding how to implement alike for my project.

I have multiple polylines, and when I move with the mouse around I would like to pick the closest point from the polyline which I’ve placed the mouse over.

Since the array of points coming from an array of points with additional properties - the best would be if I can get the index of the closest point.

Is there a way to do this ?

Is this not possible ?