gpt4 book ai didi

android - 如何在两个 Latlong 点之间画线?

转载 作者:行者123 更新时间:2023-11-29 16:58:43 24 4
gpt4 key购买 nike

使用 Polyline 我可以在两点之间创建一条路径。

但是当我使用这两点时(艾哈迈达巴德到纽约)不创建折线。否则,如果两点之间没有 SEA,它会起作用。

当点数像这样时我遇到了问题

enter image description here

但在这种情况下,它是从普杰到艾哈迈达巴德工作 enter image description here

最佳答案

最后我得到了 OlaUber 应用如何执行这些操作的答案..

enter image description here

ArrayList<LatLng> points = new ArrayList<LatLng>();
PolylineOptions polyLineOptions = new PolylineOptions();
points.add(new LatLng(from_latitude,from_longitude));
points.add(new LatLng(to_latitude,to_longitude));
polyLineOptions.width(7 * 1);
polyLineOptions.geodesic(true);
polyLineOptions.color(activity.getResources().getColor(R.color.black));
polyLineOptions.addAll(points);
Polyline polyline = mMap.addPolyline(polyLineOptions);
polyline.setGeodesic(true);

关于android - 如何在两个 Latlong 点之间画线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43652205/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com