4

I want to make this task and I´ve found some libraries to do that here by tyczj and here by akexorcist. These are good solutions but this libraries use httpClient and currently is deprecated, is there others?. Thanks.

It could be useful.

Community
  • 1
  • 1
Rene Limon
  • 614
  • 4
  • 16
  • 34
  • [akexorcist](https://stackoverflow.com/questions/14554078/is-there-a-way-to-show-road-directions-in-google-map-api-v2/15053948#15053948) that works for me – Wilmer Sep 15 '21 at 01:53

1 Answers1

3
  1. Make your own http request to get directions information from The Google Directions API and get overview_polyline string from response.
  2. Decode the string using android-maps-utils library with PolyUtil.decode method.

  3. Add decoded points to map:

    List<LatLng> decodedPoints = PolyUtil.decode(polylineString);
    PolylineOptions options = new PolylineOptions();
    options.width(6);
    options.color(Color.RED);
    options.addAll(decodedPoints);
    
    map.addPolyline(options);
    
Aryan Najafi
  • 2,496
  • 27
  • 29
  • I´ve been reading docs but i don´t know how to put the new Api key from this Direction Api cause I have already API KEY for maps – Rene Limon Jul 24 '15 at 15:33