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...?
Asked
Active
Viewed 800 times
0
-
Do you get the bearing of the road/path in your routing data? – Muhammad Babar Apr 19 '17 at 12:03
-
No...I have only Source location Lat,Lng and End Location Lat,Lng – Suhas Kurade Apr 19 '17 at 12:30
3 Answers
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?
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.
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