0

I am using the Google Places api to get places data:

https://maps.googleapis.com/maps/api/place/search/json? + "location=" + strlatitude + "," + strlongitude + "&" +"radius=" + searchRadius + "&" +"types="+ types + "&" + "sensor=true" + "&" + "key=" + googleAPIKey;

I am just getting only "icon" from this response.But I want to get image of that place.

Is there any parameter to get the image of the places?

Additionally, how can I get reviews of the places (like 9reviews, 6reviews, etc.)

4

2 回答 2

0

您可以image_link使用获取JSONObject,并且可以使用 轻松将特定链接转换为图像Bitmap

例如,image_linkJson

JSONObject jsonObj = new JSONObject(Global.JSON.toString()); 

// Creating JSON Parser instance
JSONArray jr=jsonObj.getJSONArray("results");

for(int h=0;h<jr.length();h++)
{       
    JSONObject js=jr.getJSONObject(h);      
    icon_array=js.getString("icon");    
}

将链接转换为图像

url = new URL("http://www.paho.org/Images/DD/PIN/whd08_banner2_eng.jpg");
//In URL pass your link

bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
image_view.setImageBitmap(bm);
于 2012-12-04T05:10:22.923 回答
0

我找到了从 Places Api 获取位置图像的链接。

试试这个链接

http://maps.googleapis.com/maps/api/streetview?size=400x400&location=40.720032,%20-73.988354&fov=90&heading=235&pitch=10&sensor=false

对于上面的链接,你会得到这样的图像 在此处输入图像描述

参考链接
https://developers.google.com/maps/documentation/streetview/

于 2012-12-05T06:06:17.920 回答