Longest path between two points in google maps

321 views Asked by At

Apparently to draw a line (Polyline) between two locations in google maps, the api draws the line with the shortest path. For example: a line between NY and London would by default go through the Atlantic. The code goes something like this:

var path = [];
path.push(marker1.getPosition());
path.push(marker2.getPosition());

var line = new google.maps.Polyline({
    path: path,
    map: map,
    geodesic: true
});

Now what I actually need is to draw the opposite line which starts from NY but goes through the Pacific and Asia then to London.

Is this even something I can achieve?

0

There are 0 answers