Get nearest Polyline to two points
<p>Given a list of polylines that are drawn on google maps, two points of latlong.
I want to get the nearest polyline to those two points.</p>

<p>one algorithm is to do it using only one point and get the nearest point to it on each polyline then calculate the nearest of those points on the polyline but it'd require too much processing.</p>

<p>so is any function in google maps api to do that ?</p>