日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

Android 实现百度地图骑行路线规划,骑行路线规划

發布時間:2023/12/20 Android 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Android 实现百度地图骑行路线规划,骑行路线规划 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

/**

* 設置路線數據。

*

* @param line 路線數據

*/

public void setData(BikingRouteLine line) {

mRouteLine = line;

}

@Override

public final List getOverlayOptions() {

if (mRouteLine == null) {

return null;

}

List overlayList = new ArrayList();

if (mRouteLine.getAllStep()?!= null

&& mRouteLine.getAllStep().size() > 0) {

for (BikingRouteLine.BikingStep step?: mRouteLine.getAllStep()) {

Bundle b = new Bundle();

b.putInt("index", mRouteLine.getAllStep().indexOf(step));

if (step.getEntrance()?!= null) {

overlayList.add((new MarkerOptions()).position(step.getEntrance().getLocation())

.rotate((360 - step.getDirection())).zIndex(10).anchor(0.5f, 0.5f)

.extraInfo(b)

.icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_line_node.png")));

}

// 最后路段繪制出口點

if (mRouteLine.getAllStep().indexOf(step) == (mRouteLine

.getAllStep().size() - 1)

&& step.getExit()?!= null) {

overlayList.add((new MarkerOptions()).position(step.getExit().getLocation())

.anchor(0.5f, 0.5f).zIndex(10)

.icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_line_node.png")));

}

}

}

// starting

if (mRouteLine.getStarting()?!= null) {

overlayList.add((new MarkerOptions()).position(mRouteLine.getStarting().getLocation())

.icon(getStartMarker()?!= null?? getStartMarker()

: BitmapDescriptorFactory.fromAssetWithDpi("Icon_start.png"))

.zIndex(10));

}

// terminal

if (mRouteLine.getTerminal()?!= null) {

overlayList.add((new MarkerOptions()).position(mRouteLine.getTerminal().getLocation())

.icon(getTerminalMarker()?!= null?? getTerminalMarker()

: BitmapDescriptorFactory.fromAssetWithDpi("Icon_end.png"))

.zIndex(10));

}

// poly line list

if (mRouteLine.getAllStep()?!= null

&& mRouteLine.getAllStep().size() > 0) {

LatLng lastStepLastPoint = null;

for (BikingRouteLine.BikingStep step?: mRouteLine.getAllStep()) {

List watPoints = step.getWayPoints();

if (watPoints?!= null) {

List points = new ArrayList();

if (lastStepLastPoint?!= null) {

points.add(lastStepLastPoint);

}

points.addAll(watPoints);

overlayList.add(new PolylineOptions().points(points).width(18).dottedLine(true)

.customTexture(getBikeRoadCustomTexture()).zIndex(0));

lastStepLastPoint = watPoints.get(watPoints.size() - 1);

}

}

}

return overlayList;

}

public BitmapDescriptor getBikeRoadCustomTexture() {

return BitmapDescriptorFactory.fromAsset("Icon_road_blue_arrow.png");

}

復制

深色

復制成功

總結

以上是生活随笔為你收集整理的Android 实现百度地图骑行路线规划,骑行路线规划的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。