Android Google Maps API v2 开始导航

标签 android google-maps android-intent xamarin.android

我有一个应用程序可以显示带有标记的 map 。当用户触摸标记时,我想为他们开始导航。

是否有一个 Intent/Activity 可以传递经度和纬度并启动用户导航应用程序?

感谢您的帮助。

最佳答案

我是这样解决的。发布的 url 是相似的。

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 是 START_LON,START_LAT 是经纬度,END_LON,END_LAT 是终点

关于Android Google Maps API v2 开始导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15027867/

相关文章:

java - Android Syncronization - 表中已存在数据

Android:检测到另一个应用程序已开始播放音频

Android:如何实现小区切换的监听器?

android - 如何让我的分享 Intent 支持 whatsapp 和 google+

javascript - JS Promise 无法返回结果

android - 创建数据库和默认数据

android - 我的程序以编程方式添加 ImageView 有什么问题

java - 如何修复 androidx.appcompat.widget.AppCompatButton 无法转换为 com.rey.material.widget.Button

javascript - 谷歌地图类型错误: xml is undefined

javascript - 打印整个页面时如何修复 Google Map API?