This application> came from my dependence on public transport and possible need to move houses; I wanted to know how close I would be in relation to train stations. There are quite a number of stations in Melbourne, and I don’t have the time to map all of their coordinates, so at the time being it only has train stations from the City Loop.
The application uses GDirections. It lets us load way points and retrieve the route details; such as distance, driving directions, and even an HTML summary of the travel.
I used GDirections in two instances of the application:
1. To determine the distance between my pivot position and the train stations.
2. To plot the route of my pivot point to the closest train station
In both instances I used GDirections in the same way:
var directions = new GDirections();
// Put pivot location and the selected train station into an array
var lArray = new Array();
lArray.push( start );
lArray.push( end );
// Load route from pivot location to train station
directions.loadFromWaypoints(lArray);
After I loaded the way points it is possible to retrieve information such as the distance in meters:
directions.getDistance().meters
However I ran into a problem: I was loading the way points but it was returning me NULL. That is because the loading is done asynchronously, so to retrieve the details we have to wait until it loads completely. To do that we create an event listener:
GEvent.addListener(directions,"load", function()
{
// Here directions should not be NULL
var distance = directions.getDistance().meters;
});
After we calculate the shortest distance, we are ready to render the route on the map. To do that I passed the map as an argument when initialising GDirections.
// Clear map and panel
map.clearOverlays();
var directions = new GDirections(map);
// Array with the shortest route
var lArray = new Array();
lArray.push( start );
lArray.push( end );
directions.loadFromWaypoints(lArray , {preserveViewport: true});
Note that I used the preserveViewport option. That is so the map won’t change zoom or position when rendering the route.
Please drop me a message if anyone knows where I can find free coordinates of the train stations, and I will add them to the application.

nice article if somebody intresting in some API coding u can check on my website:
http://www.ontour.lt/distances-between-cities/
http://www.ontour.lt/lithuania-world-map/
i think u can find some scripts worth to look at too.
Thanx again
You can also follow the popular banana diet, which entails eating a raw banana and drinking room temperature water for breakfast.
There are many diet plans that are available for you to
try but make sure you have success with them. Luckily Asian
women get thin and burn fat easily, even after giving birth, and
do it in a healthy way that anyone can learn.