Android Google Maps API v2开始导航 [英] Android Google Maps API v2 start navigation
本文介绍了Android Google Maps API v2开始导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个应用程序,显示带有标记的地图。当用户触摸标记时,我想为它们开始导航。
I have an app that displays a map with a marker. When the user touches the marker I want to start navigation for them.
是否有我可以通过一个经度和纬度和启动theusers导航应用的Intent /活动?
Is there an Intent/Activity that I can pass a longitude and latitude and start theusers navigation app?
感谢您的帮助。
推荐答案
我解决了这个问题。发布URL是相似的。
I solved it like this. The url posted is similar.
Intent navigation = new Intent(
Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=START_LAT,START_LON&daddr=END_LAT,END_LON"));
startActivity(navigation);
其中开始是START_LON和START_LAT是经度和纬度和END_LON,END_LAT是结束
Where Start is the START_LON and START_LAT is the longitude and latitude and END_LON, END_LAT is the end
这篇关于Android Google Maps API v2开始导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文