GautamK11
GautamK11

Reputation: 71

google nearby places api to display places types and places count

I want to display the places types first & places count while clicking on the types,i want to display the particular type only.please provide the solution for it.i am providing the screenshot my screen.every time category clicked i have to hit the google url it will not good way.please suggest me simple way to use it.enter image description here

Upvotes: 0

Views: 635

Answers (1)

Ajaykumar Mistry
Ajaykumar Mistry

Reputation: 964

This is very simple ...try this code:

StringBuilder url = new StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
    url.append("location=" + latLng.latitude + "," + latLng.longitude);
    url.append("&radius=5000");
    url.append("&types=" + "gas_station");
    url.append("&sensor=true");
    url.append("&key=your key");

here i used gas_station , you can use as per your need

use this api in each option and just change &types="" according to your options.

for supported types you have to refer this link

Upvotes: 1

Related Questions