【问题标题】:how to draw polyline on map with forward direction arrow from source to destination in android如何在地图上使用从源到目的地的正向箭头在android中绘制折线
【发布时间】:2017-04-19 10:21:53
【问题描述】:

我想在 android 的谷歌地图上绘制从源到目的地的路径。 path 只不过是一条折线,带有从源到目标的正向箭头。通过使用计算航向方法可以绘制...?

【问题讨论】:

  • 您是否在路线数据中获得道路/路径的方位?
  • 不...我只有源位置 Lat,Lng 和结束位置 Lat,Lng

标签: android


【解决方案1】:

这在 Google Maps API 中不是标准的,请查看此处以使用显示您所在方向的箭头的位图来实现它:How can I use a custom bitmap for the "you are here" point in a MyLocationOverlay?

【讨论】:

    【解决方案2】:

    您必须创建从源位置到目的地的 LatLng 列表。你可以customize折线平面箭头图片。

    'com.google.maps.android:android-maps-utils:0.3.4' 将帮助您计算航向。

    LenovoS90's将为您提供更详细的帮助。

    【讨论】:

      【解决方案3】:

      您必须从startingLatLong 到endingLatLong 拨打下方的add(LatLong)

      mMap.addPolyline(new PolylineOptions().geodesic(true).add(startingLatLong ).add(endingLatLong ));
      

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多