简体   繁体   English

在我的Android应用上全面实施Google地图路线服务

[英]Full implementation of Google Maps Directions Service on My Android App

I have searched for hours on the web for an example of implementing the direccions service on my android app. 我已经在网上搜索了几个小时,以便在我的Android应用程序上实现direccions服务。

I am using the google maps android api 2.

Basically I want the directions from the actual position and a marker position selected by the user. 基本上我想要实际位置的方向和用户选择的标记位置。

I want to make clear that I don´t want to launch a web browser or the google maps aplication, I want to implement the service on my own app. 我想明确表示我不想启动网络浏览器或谷歌地图应用程序,我想在我自己的应用程序上实现该服务。

Till now I found some examples about drawing the route on tha map, which are ok 到目前为止,我发现了一些关于在地图上绘制路线的例子,这些都没问题

http://wptrafficanalyzer.in/blog/gps-and-google-map-in-android-applications-series/ http://wptrafficanalyzer.in/blog/gps-and-google-map-in-android-applications-series/

Get driving directions using Google Maps API v2 使用Google Maps API v2获取行车路线

so I just miss the indications part of the service so y can show on my own listview with arrows (turn to left , to right , etc). 所以我只是错过了服务的指示部分,所以你可以用箭头在我自己的列表视图中显示(转到左边,右边等)。

Thanks for reading my question 感谢您阅读我的问题

I'm not sure what you want. 我不确定你想要什么。 In your second link about Google Map API v2, the data for drawing maps comes from maps.googleapis.com .You can see https://developers.google.com/maps/documentation/directions/ for more documentation about that. 在关于Google Map API v2的第二个链接中,绘制地图的数据来自maps.googleapis.com。您可以查看https://developers.google.com/maps/documentation/directions/以获取更多相关文档。

The xml returned from maps.googleapis.com include <html_instructions> tag which contains instruction like turn left or turn right . 从maps.googleapis.com返回的xml包含<html_instructions>标记,其中包含turn leftturn right等指令。 So you just need to parse that xml and use <html_instructions> tag for information you need on your listview . 因此,您只需要解析该xml并使用<html_instructions>标记获取listview所需的信息。

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM