title: Find a point in a polyline which is closest to a latlng
body: <p>i have a polyine which i have drawn with latlngs obtained from google maps directions service.
  Now i want to find a point on the polyline that is closest to a given point.</p>
  
  <p>The obvious way (to me) is to kind of loop through all the points in the polyline and find the distance between them and the given point, however this is inefficient because the points on the polyline can potentially be large.</p>
  
  <p>I would be glad to hear any alternatives of doing this.
  Thanks in advance.</p>