Hii,
I try to use GDirections while showing calculated routes on the map.
I am using Gridections like that:
GDirectionsRequestForPolyline: function (QueueItem, algID) {
//newDirn = new Array();
var FromStation = globals.Stations.get(QueueItem.StationId1);
var ToStation = globals.Stations.get(QueueItem.StationId2);
RequestedGDirection = new GDirections();
GEvent.addListener(RequestedGDirection,"error",
globals.ResultOperations.GDirectionFunctionFailure);
GEvent.addListener(RequestedGDirection,"load",
globals.ResultOperations.GDirectionFunctionSuccess);
var waypoints = new Array();
var fromLatLon = FromStation.Lat+","+FromStation.Lon;
waypoints[0] = fromLatLon;
var toLatLon = ToStation.Lat+","+ToStation.Lon;
waypoints[1] = toLatLon;
var reqString = "from:" + fromLatLon + " to:" + toLatLon;
console.log('Request made between: '+reqString);
//.RequestedGDirection.loadFromWaypoints(waypoints,
globals.PolylineLoadOption);
//RequestedGDirection.load(reqString, globals.PolylineLoadOption);
RequestedGDirection.load(waypoints, globals.PolylineLoadOption);
},
globals.ResultOperations.GDirectionFunctionFailure = function(){
console.log('GDirectionFunctionFailure');
},
globals.ResultOperations.GDirectionFunctionSuccess = function(){
console.log('GDirectionFunctionSuccess');
},
I try in three different ways:
- RequestedGDirection.loadFromWaypoints(waypoints,
globals.PolylineLoadOption)
- RequestedGDirection.load(reqString, globals.PolylineLoadOption);
- RequestedGDirection.load(waypoints, globals.PolylineLoadOption);
When I run the the function in firebug I see:
Request made between: from:50.6529426574707,7.66845703125 to:
50.7225456237793,7.09716796875
But none of these do not make response (no success or failure in
firebug console).
Thanks for your advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---