使用谷歌地图API第2版谷歌地图导航 [英] Google map navigation using Google Maps API v2

查看:138
本文介绍了使用谷歌地图API第2版谷歌地图导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用谷歌地图API V2在我的应用程序。我想启用导航功能在我的应用程序。我看了其中启动意图和开放式股票型谷歌地图应用程序,以显示导航其他职位。但我想( SupportMapFragment ,我是用)只显示我的应用程序中导航。我怎样才能实现呢?

这code效果很好,但它启动了意图

 意图NavIntent =新的意图(Intent.ACTION_VIEW,Uri.parse(google.navigation:Q =+ incAddress));
    startActivity(NavIntent);
 

解决方案

有没有办法展现在你的应用程序中的谷歌地图应用程序的导航,它是一个完全不同的应用程序。可以显示导航你的应用程序的唯一方法是使用谷歌路线API 并绘制在地图上的路线,但是,你不要有轮流转的方向。

我创建了一个使用谷歌的方向API库和易于使用的,如果你想尝试一下。

https://github.com/tyczj/MapNavigator

I am using Google Maps API v2 in my app. I want to enable navigation feature in my app. I have read other posts which start an Intent and open stock Google Maps application to show navigation. But I want to display the navigation inside my application(SupportMapFragment that I have used) only. How can I implement that?

This code works well but it starts an Intent :

Intent NavIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + incAddress));
    startActivity(NavIntent);

解决方案

there is no way to show the google maps app navigation in your app, it is a completely different app. the only way you can display navigation in your app is to use Google Directions API and plot the route on your map but then you dont have the turn by turn directions.

I created a library that uses the google directions api and its easy to use if you want to try it out.

https://github.com/tyczj/MapNavigator

这篇关于使用谷歌地图API第2版谷歌地图导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆