0

I want to draw an path from source to destination on google map in android. path is nothing but an polyline with forward direction arrows from source to destination. By using compute heading method is it possible to draw...?

3 Answers3

0

This is not standard in the Google Maps API, have a look here to implement it using a bitmap which is displaying an arrow in your direction: How can I use a custom bitmap for the "you are here" point in a MyLocationOverlay?

Community
  • 1
  • 1
Denny
  • 1,766
  • 3
  • 17
  • 37
0

you have to create the List of LatLng starting from source location to destination. You can customize the polylines flat arrow images.

'com.google.maps.android:android-maps-utils:0.3.4' will help you to compute the heading.

LenovoS90's will help you more in detail.

Community
  • 1
  • 1
Akshay
  • 6,029
  • 7
  • 40
  • 59
0

You have to call add(LatLong) below from startingLatLong till endingLatLong

mMap.addPolyline(new PolylineOptions().geodesic(true).add(startingLatLong ).add(endingLatLong ));
Arsalan Khan
  • 403
  • 3
  • 11
  • It only draw polyline. I have modified above code but not getting proper result. – Suhas Kurade Apr 19 '17 at 11:07
  • [Draw route between two points](https://www.androidtutorialpoint.com/intermediate/google-maps-draw-path-two-points-using-google-directions-google-map-android-api-v2/) – Arsalan Khan Apr 20 '17 at 07:03