2

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

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

收到一个起始位置,去完成该位置已更改为原来的位置等等。如何?

例子。

在谷歌地图上绘制一条线/路径 如何解析点并在 Android 的谷歌地图上绘制一条路线?

谢谢。

4

1 回答 1

2

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

在 Google maps API V2 中,您可以添加/删除折线以向您显示方向。这些折线将连接纬度点。

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

在 GoogleMap SupportMapFragment 上绘制 2 个 GeoPoints 之间的行车路线

现在,您将如何实施您的位置更新和您想要的目的地更新,这取决于您:

需要考虑的重要事项: 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
于 2013-03-02T19:44:13.243 回答