如何将半径地图转换为公里或米?

How to convert radius map to km or meter?

正在将半径比转换为千米或米。

如果我把 radius=500 会怎样?半径 500 与公里或米的等效值是多少?

1 半径等于多少千米?

   StringBuilder googlePlacesUrl = new StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
        googlePlacesUrl.append("location=" + latitude + "," + longitude);
        googlePlacesUrl.append("&radius=10000");
        googlePlacesUrl.append("&type=" + "art_gallery");
        googlePlacesUrl.append("&sensor=true");
        googlePlacesUrl.append("&key=" + "AIzaSyCx8-ZK6m5FTgEoTaSRaUuALV-5Vnz1Co4");
        Log.d("getUrl", googlePlacesUrl.toString());
        return (googlePlacesUrl.toString());

半径参数以米为单位。所以你应该转换为米,然后在下面传递它url。

StringBuilder googlePlacesUrl = new StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
    googlePlacesUrl.append("location=" + latitude + "," + longitude);
    googlePlacesUrl.append("&radius=10000");
    googlePlacesUrl.append("&type=" + "art_gallery");
    googlePlacesUrl.append("&sensor=true");
    googlePlacesUrl.append("&key=" + "AIzaSyCx8-ZK6m5FTgEoTaSRaUuALV-5Vnz1Co4");
    Log.d("getUrl", googlePlacesUrl.toString());
    return (googlePlacesUrl.toString());