I want to display driving path on google map using api v2. I have a source, destination and some way point between those two points. and for this I am using below code and it works fine, but problem is when i have less then 10 points then it works find but when i added more then 10 points then api returns error.
below is my code for generating url -
api -
https://maps.googleapis.com/maps/api/directions/json?
code -
public static String getDirectionsUrl(LatLng origin,LatLng dest,ArrayList<LatLng> mLatLongAL,String url){
try{
String str_origin = "origin="+origin.latitude+","+origin.longitude;
String str_dest = "destination="+dest.latitude+","+dest.longitude;
String sensor = "sensor=false";
String waypoints = "";
for(int i=0;i<mLatLongAL.size();i++){
LatLng point = (LatLng) mLatLongAL.get(i);
if(i==0)
waypoints = "waypoints=";
waypoints += point.latitude + "," + point.longitude + "|";
}
String parameters = str_origin+"&"+str_dest+"&"+sensor+"&"+waypoints;
String mUrl = url+parameters;
return mUrl;
}
catch(Exception e){
e.printStackTrace();
}
return null;
}
how to get path for more then 10 way points.
Thanks in Advance.