本文介绍了谷歌地图Android版:我如何添加驾车或步行路线到一个特定的GeoPoint用的onclick的一个按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拍图我的校园和需要帮助。谁能告诉我怎么找到方向添加到特定的GeoPoint?我想用户点击地图图标在地图上,把他们那个地方的描述页面,然后可以选择路径方向看似简单,但我很新的Java和Android系统。

I'm making a map for my campus and need help. Can anyone tell me how to add driving directions to a specific geopoint? I would like the user to click on a map icon on the map, bring them to a description page of that place, and then have the option to "route directions" Seems simple but I'm very new to Java and Android.

推荐答案

最简单的办法是链接到谷歌地图应用程序。下面的网址会处理的。

The easiest option would be to link out to the Google Maps application. The URL below will handle that.

Uri uri= Uri.parse( "http://maps.google.com/maps?saddr=" + startLocation.getLatitude() + "," + startLocation.getLongitude() + "&daddr="+mapItem.lat + "," + mapItem.lon );
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
mActivity.startActivity(intent);

另外,请查阅本页面中的所有地图网址的选项:

Also check out this page for all the options in the maps url:

这篇关于谷歌地图Android版:我如何添加驾车或步行路线到一个特定的GeoPoint用的onclick的一个按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 01:59