Google map API v.3 find nearest point from one point to point on polyline
<p>I`ve got a map with a polyline. The server will responds me with a LatLng point on a map. I need to check if the point from the server situated on a polyline edge. If not, i need to find the nearest point on the polyline and place a marker on the nearest point on the polyline. For example, if the server responds me with a point A, i need to place a marker to a point B.</p>

<p><a href="https://i.stack.imgur.com/ib7BT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ib7BT.jpg" alt="enter image description here"></a></p>

<p>I find a good library <a href="http://wtp2.appspot.com/cSnapToRouteDemo.html" rel="nofollow noreferrer">http://wtp2.appspot.com/cSnapToRouteDemo.html</a>, but this library is for Google API ver. 2, and i'm using Google API ver. 3. Is there any alternative for Google API ver. 3 ? Thank's.</p>