0

In my application I have some point list which I want to send to intent map and it should find directions for all the point in the list . I mean multiple path, Also when I'm using way points it just appears in the browser and I get 'no results' message in the intent map. I have already used this tutorial:
Visit https://stackoverflow.com/a/40014802/5144769/

String jsonURL = "https://maps.google.com/maps?";
    final StringBuffer sBuf = new StringBuffer(jsonURL);
    sBuf.append("saddr=");
    sBuf.append("35.742257");
    sBuf.append(',');
    sBuf.append("51.441882");
    sBuf.append("&daddr=");
    sBuf.append("35.754777");
    sBuf.append(',');
    sBuf.append("51.290822");
    sBuf.append("+to:");
    sBuf.append(latLang.get(0).latitude);
    sBuf.append(',');
    sBuf.append(latLang.get(0).longitude);
    sBuf.append("+to:");
    sBuf.append(latLang.get(1).latitude);
    sBuf.append(',');
    sBuf.append(latLang.get(1).longitude);
    sBuf.append("+to:");
    sBuf.append(latLang.get(2).latitude);
    sBuf.append(',');
    sBuf.append(latLang.get(2).longitude);
    sBuf.append("+to:");
    sBuf.append(latLang.get(3).latitude);
    sBuf.append(',');
    sBuf.append(latLang.get(3).longitude);
    sBuf.append("+to:");
    sBuf.append(latLang.get(4).latitude);
    sBuf.append(',');
    sBuf.append(latLang.get(4).longitude);

    sBuf.append("&key=");
    sBuf.append(getActivity().getResources().getString(R.string.google_api_key));


        Intent sendLocationToMap = new Intent(Intent.ACTION_VIEW,
            Uri.parse(sBuf.toString()));
    startActivity(sendLocationToMap);

0 Answers0