现在正在研究如何最好地实时绘制路径。获取坐标并提前绘制等等..
网络中的资料是。但我无法理解以下内容。 有许多继承Overlay的例子然后实现draw()方法和draw。但是这个我们将有一次性的,我需要经常画画。
收到一个起始位置,去完成位置已经改变到原来的位置等等。 怎么样?
实施例
Drawing a line/path on Google Maps How can I parse out points and draw a route on a Google Map in Android?
感谢。
答案 0 :(得分:2)
首先,从您的标记开始,您指向的是Google Maps API V2 发布适用于Google Maps API V1。这就是说,这意味着您没有叠加对象, GeoPoint 也不是您应该用来向您显示方向位置的对象。
在Google Maps 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