我添加了折线,但无法在谷歌地图上添加带方向的箭头,应显示如下 
我曾尝试阅读各种博客和代码,但无法实现目标
我在下面使用了以下代码片段:
private void DrawArrowHead(MarkerOptions MO, GoogleMap mMap, LatLng from, LatLng to) {
// obtain the bearing between the last two points
double bearing = GetBearing(from, to);
// round it to a multiple of 3 and cast out 120s
double adjBearing = Math.round(bearing / 3) * 3;
while (adjBearing >= 120) {
adjBearing -= 120;
}
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
// Get the corresponding triangle marker from Google
URL url;
Bitmap image = null;
try { …Run Code Online (Sandbox Code Playgroud) android google-maps google-directions-api google-polyline google-maps-android-api-2