I am trying to record the start and end location of a route. I see that the GetRoute method is supposed to return a VERoute object, and I know that i have to get this information from this object. The question I have is how to actually store the VERoute object that is returned. From the documentation I tried two options, but neither of them work:
Option 1:
var myRoute = map.GetRoute("Space Needle", "Microsoft", null, null, null;
var start = myRoute.StartLocation.LatLong;
var end = myRoute.EndLocation.LatLong;
Option 2:
...
map.GetRoute("Space Needle", "Microsoft", null, null, "onRouteReturned");
...
//later on in the code
function onRouteReturned( myRoute )
{
var start = myRoute.StartLocation.LatLong;
var end = myRoute.EndLocation.LatLong;
}
I'm also new to javascript, so maybe I am completely off base.
Any help would be appreciated.