How to draw a line between two points (Latitude and Longitude) with the Google map API using jQuery or Javascript? I need the shortest path between the two points. It may be
For API v2 only!
The following code snippet creates a 10-pixel-wide red polyline between two points:
var polyline = new GPolyline([ new GLatLng(37.4419, -122.1419), new GLatLng(37.4519, -122.1519)], "#ff0000", 10); map.addOverlay(polyline);
You can find the documentation here.