0

I have built the following url with source and destination points as follows

String jsonURL = "http://maps.googleapis.com/maps/api/directions/json?";
        final StringBuffer sBuf = new StringBuffer(jsonURL);
        sBuf.append("origin=");
        sBuf.append(start.getLatitudeE6()/1E6);
        sBuf.append(',');
        sBuf.append(start.getLongitudeE6()/1E6);
        sBuf.append("&destination=");
        sBuf.append(dest.getLatitudeE6()/1E6);
        sBuf.append(',');
        sBuf.append(dest.getLongitudeE6()/1E6);
        sBuf.append("&sensor=true&mode=driving");

Final url is

http://maps.googleapis.com/maps/api/directions/json?origin=17.449672,78.373002&destination=40.686245,-93.399375&sensor=true&mode=driving

But I am getting "routes" : []. So that I am unable to draw the path betweeen source and destination. Can any one tell me what went wrong here.

1 Answers1

1

How could you expect to have a route between Hyderabad, India to Alerton, USA. Thats the reason the routes are zero. Try this it returns proper results, http://maps.googleapis.com/maps/api/directions/json?origin=17.449672,78.373002&destination=17.402531,78.377752&sensor=true&mode=driving

naveen
  • 36
  • 3