显示的附近地点距离比半径大

时间:2019-01-15 16:10:51

标签: android google-maps google-places-api

我正在使用Google Place API从用户位置检测附近的计算机商店。我已将半径设置为5000。我想让计算机商店的距离为5 km,但是结果发现计算机商店的距离超过10 km。这是我的代码。

private String getUrl(Double latitude, Double longitude, String nearbyPlace)

{
    StringBuilder googleURL = new StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
    googleURL.append("&location=" + latitide + "," + longitude);
    googleURL.append("&radius=" +5000);
    googleURL.append("&keyword=" + nearbyPlace);
    googleURL.append("&sensor=false");
    googleURL.append("&key=" + "mykey");
    Log.d("GoogleMapsActivity", "url = " + googleURL.toString());
    return googleURL.toString();
}

0 个答案:

没有答案
相关问题