显示当前位置和附近的地方和路线两地之间使用谷歌地图API在Android中 [英] Show Current Location and Nearby Places and Route between two places using Google Maps API in Android

查看:108
本文介绍了显示当前位置和附近的地方和路线两地之间使用谷歌地图API在Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用开发一个应用程序谷歌地图 Android中找到我的当前位置的和需要的找到最近的位置

(例如:从我目前的位置的附近派出所

它应该接受我的当前位置和输出应该显示最近的地方。

谁能帮我给一些建议,链接,教程做到这一点?

解决方案
  1. 先通过 本教程 获取熟悉 Android的谷歌地图,这对于 API 2

  2. 以检索设备的当前位置见 <一个href="http://stackoverflow.com/questions/1513485/how-do-i-get-the-current-gps-location-programmatically-in-android">this回答 或本 <一个href="http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a/3145655#3145655">another回答 API 2

  3. 然后你可以通过你的位置,使用 谷歌将获得地方靠近     API 并使用场所的API看到的 这博客

  4. 按位置使用越来越近地标后的 <一个href="http://wptrafficanalyzer.in/blog/customizing-infowindow-contents-in-google-map-android-api-v2-using-infowindowadapter/">this 博客与源$ C ​​$ C ,以显示与气球叠加标志在地图上用API 2。

  5. 您也有很大的eample画在地图上两点间的路由 看看这里这些链接 <一个href="http://stackoverflow.com/questions/2023669/j2me-android-blackberry-driving-directions-route-between-two-locations/2023685#2023685">Link1 <一个href="http://about-android.blogspot.in/2010/03/sample-google-map-driving-direction.html">Link2这<一href="http://stackoverflow.com/questions/3109158/how-to-draw-a-path-on-a-map-using-kml-file">Great答

执行这些步骤后,您将能够轻松地做你的应用程序。条件是唯一的,你必须阅读和理解,因为喜欢魔术的不会是完整的点击。

I need to develop an application using Google Maps in Android to locate my current location and need to find nearest location.

(For example: Nearby police station from my current location.)

It should accept my current location and output should display nearest place.

Can anyone help me to give some suggestion,links,tutorial to do that?

解决方案

  1. First go through this tutorial for getting familiar with Android Google Maps and this for API 2.

  2. To retrive the current location of device see this answer or this another answer and for API 2

  3. Then you can get places near by your location using Google Place API and for use of Place Api see this blog.

  4. After getting Placemarks of near by location use this blog with source code to show markers on map with balloon overlay with API 2.

  5. You also have great eample to draw route between two points on map look here in these links Link1 and Link2 and this Great Answer.

After following these steps you will be easily able to do your application. The condition is only that you will have to read it and understand, because like magic its not going to be complete in a click.

这篇关于显示当前位置和附近的地方和路线两地之间使用谷歌地图API在Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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