简体   繁体   English

在Android中使用Google Places查找附近地点的有效方法是什么?

[英]What is the efficient way to find nearby places using google places in android?

What I need from google place api is to display me some tag places, by that i mean particular category, lets say school or hospitals etc. I have came across with few tutorials here 我需要从Google Place API获得的是向我显示一些tag位置,即我所说的特定类别,比如说schoolhospitals等。我在这里遇到了一些教程

  1. Javapapers.com Javapapers.com
  2. wptrafficanalyzer wptrafficanalyzer

both of them are pretty good but it's lengthy, and hence might consume a lot of space. 他们两个都不错,但是很长,因此可能会占用很多空间。 What i want to do is simply request for the places with the place-type and get the name and location as well and display it to the user. 我想要做的就是简单地request具有place-type的场所,并获取名称和位置,并将其显示给用户。

How do i do that? 我怎么做?

U can use google place api for android. 您可以使用适用于Android的Google Place API。

https://developers.google.com/places/android/start#api-key https://developers.google.com/places/android/start#api-key

You would want to add type parameter 您将要添加类型参数

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=cruise&key=API_KEY

You can see all support types here 您可以在此处查看所有支持类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM