Hi All,
I am trying get direction between two cities using google maps Javascript
API.  If i try the following two cities, it is not giving anything.
*Two cities : london and  Chicago, Cook, Illinois*
I suspect this is because of the direction status value. Initially i used
only OK status value. Then i added all the direction status value in the
code.
still i didn't get anything.
Anyone please tell me how to handle those direction status value?
*
NOTE:*
I tried the same two cities in the maps.google.com. It was giving like "No
route found". I want to get the output like that. how do i get that?
*
My code:*
 function calcRoute() {
    //var start = document.getElementById("start").value;
    //var end = document.getElementById("end").value;
    var start = "*london*";
    var end = "*Chicago, Cook, Illinois*";
    var request = {
        origin:start,
        destination:end,
        travelMode: google.maps.DirectionsTravelMode.DRIVING
    };
    directionsService.route(request, function(response, status) {
      if (status == google.maps.DirectionsStatus.OK) {
        alert("1");
        directionsDisplay.setDirections(response);
      }
      if(status == google.maps.DirectionsStatus.INVALID_REQUEST){
      alert("2");
       }
       if(status == google.maps.DirectionsStatus.MAX_WAYPOINTS_EXCEEDED){
       alert("3");
        }
        if(status == google.maps.DirectionsStatus.NOT_FOUND){
        alert("4");
         }
         if(status == google.maps.DirectionsStatus.OVER-QUERY_LIMIT){
         alert("5");
         }
         if(status == google.maps.DirectionsStatus.REQUEST_DENIED){
         alert("6");
         }
         if(status == google.maps.DirectionsStatus.UNKNOWN_ERROR){
         alert("7");
          }
         if(status == google.maps.DirectionsStatus.ZERO_RESULTS){
         alert("8");
         }
    });
  }
*
output:
**No alert is coming.

If i try germany and london, it is giving alert  as "1".
*--
*Regards,*
*Karthick
*

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to