20m圏内のどの銀行でもGoolge Places Pagesをlong/latで検索する必要があります。 このGoogle Places Docには、JavaScriptを使用して行う方法が記載されています。彼らは私がJavaに持っていないgoogle.maps.LatLng
オブジェクトを使用しています。JavaでGoogleプレイス検索リクエストを送信するには
どのようにしてこのサービスに電話をかけることができますか?
多分Goolge Places用のJava APIもありますか?
最高のお礼、 キリスト教徒です。
編集1:私はので、私はそれを行う方法を見つけた上記のポストの
:
String url = baseUrl + "location=" + lat + "," + lon + "&" +
"radius=" + searchRadius + "&" + types + "&" + "sensor=true" +
"&" + "key=" + googleAPIKey;
回答:編集2
私はsomeoneは、このようなURLを構築しました。これは、要求を送信する方法の例です:
public class GooglePlacesClient
{
private static final String GOOGLE_API_KEY = "***";
private final HttpClient client = new DefaultHttpClient();
public static void main(final String[] args) throws ParseException, IOException, URISyntaxException
{
new GooglePlacesClient().performSearch("establishment", 8.6668310, 50.1093060);
}
public void performSearch(final String types, final double lon, final double lat) throws ParseException, IOException, URISyntaxException
{
final URIBuilder builder = new URIBuilder().setScheme("https").setHost("maps.googleapis.com").setPath("/maps/api/place/search/json");
builder.addParameter("location", lat + "," + lon);
builder.addParameter("radius", "5");
builder.addParameter("types", types);
builder.addParameter("sensor", "true");
builder.addParameter("key", GooglePlacesClient.GOOGLE_API_KEY);
final HttpUriRequest request = new HttpGet(builder.build());
final HttpResponse execute = this.client.execute(request);
final String response = EntityUtils.toString(execute.getEntity());
System.out.println(response);
}
}
あなたは私の人生を保存していただきありがとうございます :) – Kunal
非常にThnks! –