Oops, guys, what's up? So I'm developing an app using Android Studio and the Google Maps API. So I came across an issue that until then I could not find anything that could solve my problem. Here's how I'm working with Routes and by default Google maps uses the "Driving" route when creating JSON to mount the route in the app. I would like to change this default travel mode to other options like bike, race, train and so on. Has anyone ever come across this and by chance managed to solve?
This is my class:
private void criarUrlGoogleDirections(){
urlGoogleDirections = "http://maps.googleapis.com/maps/api/directions/json?origin=" +
latLngPontoPartida.latitude + "," + latLngPontoPartida.longitude +
"&destination=" + latLngPontoFinal.latitude + "," + latLngPontoFinal.longitude +
"&waypoints=";
for (int i = 0; i < objListaLatLngWaypoints.size(); i++) {
urlGoogleDirections += objListaLatLngWaypoints.get(i).latitude
+ "," + objListaLatLngWaypoints.get(i).longitude;
if ((i+1) < objListaLatLngWaypoints.size()) {
urlGoogleDirections += "|";
}
}
urlGoogleDirections += "&sensor=false";
Log.i("URL", urlGoogleDirections);
}