gpt4 book ai didi

android - 实时谷歌地图 v2 路线?

转载 作者:行者123 更新时间:2023-11-29 00:32:09 25 4
gpt4 key购买 nike

这里正在研究如何最好地实时绘制路径。获取坐标并提早绘制等等..

资料在网络上。但我无法理解以下内容。有很多例子都是继承Overlay然后实现draw()方法进行绘制。但这我们会有一次性的,我需要不断地画画。

收到起始位置,完成位置已更改为原来的位置等等。怎么办?

例子。

Drawing a line/path on Google Maps How can I parse out points and draw a route on a Google Map in Android?

谢谢。

最佳答案

首先,您从您的标签指向 Google Maps API V2,而您的链接发布适用于 Google Maps API V1。也就是说,这意味着您没有要使用的 Overlay 对象,GeoPoint 也不是您应该用来显示方向位置的对象。

在 Google map API V2 中,您可以添加/删除多段线 来向您显示方向。这些折线将连接 LatLng 点。

现在要查找路线,您可以使用 Google Direction API。这是一篇关于如何查找路线并在 Google Map API V2 上显示它们的帖子:

Draw driving route between 2 GeoPoints on GoogleMap SupportMapFragment

现在您将如何实现您的位置更新和您想要的目的地更新由您决定:

需要考虑的重要事项:Google Maps API 服务条款并未正式允许使用 Google Maps API 获取行车路线:

Google Maps/Google Earth APIs Terms of Service

Last updated: May 27, 2009

...

10. License Restrictions. Except as expressly permitted under the Terms, or unless you
have received prior written authorization from Google (or, as applicable, from the
provider of particular Content), Google's licenses above are subject to your adherence
to all of the restrictions below. Except as explicitly permitted in Section 7 or the
Maps APIs Documentation, you must not (nor may you permit anyone else to):

...

10.9 use the Service or Content with any products, systems, or applications for or in
connection with:

(a) real time navigation or route guidance, including but not limited to turn-by-turn
route guidance that is synchronized to the position of a user's sensor-enabled device;


and may be disabled for certain apps (somehow, at least on Android)... FromGeocode
scraping in .NET conversation:
This is not allowed by the API terms of use. You should not scrape Google Maps to
generate geocodes. We will block services that do automated queries of our servers.

Bret Taylor

Product Manager, Google Maps

关于android - 实时谷歌地图 v2 路线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14873491/

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