Google Maps - the shortest route between two points using this polyline.

I am developing a prototype public transport web page for my city. This is a typical page on which you can enter the source and address of fate, and the page shows which bus lines you must take to move around the city.

I ran into a big problem: from point A to point B there is a bus line in the same direction of movement (represented by a polyline). I find the best bus line calculating the lowest distance between points and a polyline. Everything is fine here, BUT, when I want to go from point B to point A (the same as before), there is no bus line in this direction, however, the page will continue to offer the bus line earlier.

In short, the bus runs between them one-sidedly, but the elongated polyline has no direction, so it works in both cases (from A to B and from B to A).

Is there a way to consider the direction of an AB polyline?

I thought of it as the shortest path between the problems of the nodes, with great expense in the directions where the tires should not go. But, I think this is a little for this. What do you think?

Thanks in advance

Update:

The idea is to use the path indicator for the polyline and consider the route (polyline) between the origin and destiny only if the path index increases between these points.

v3_BdccGeo.js, , , . , , , ( ).

- , .

2:

! , , v3_BdccGeo.js , .

+4

All Articles