I have polylines working for directions form two locations on Android Google Maps API, however, you can tell that the corners are jagged and not smooth. Are there any steps to take to smooth these lines out to appear more natural (like on google's own maps site)
Below is the class that is called with appropriate parameters to create the polylines
public class GetDirectionsData extends AsyncTask<Object, String, String> {
String googlePlacesData;
GoogleMap mMap;
String url;
LatLng latlng;
@Override
protected String doInBackground(Object... objects) {
mMap = (GoogleMap)objects[0];
url = (String)objects[1];
latlng = (LatLng)objects[2];
DownloadUrl downloadUrl = new DownloadUrl();
try {
googlePlacesData = downloadUrl.readUrl(url);
} catch (IOException e) {
e.printStackTrace();
}
return googlePlacesData;
}
@Override
protected void onPostExecute(String s){
String[] directionsList;
DataParser parser = new DataParser();
directionsList = parser.parseDirections(s);
displayDirections(directionsList);
}
public void displayDirections(String[] directionsList){
int count = directionsList.length;
for(int i = 0; i<count; i++){
PolylineOptions options = new PolylineOptions();
options.color(Color.rgb(0,179,253));
options.width(15);
options.addAll(PolyUtil.decode(directionsList[i]));
mMap.addPolyline(options);
}
}