在Android地图中搜索距离我当前位置最近的位置

在Android地图中搜索距离我当前位置最近的位置,android,map,Android,Map,在我的android应用程序中,我想在地图中搜索距离我当前位置最近的5个地方。这些参数用于设置边界lowerLeftLatitude、lowerLeftLatitude、upperRightLatitude、upperRightLatitude。但我不知道如何设置它们的值 该代码给出了5个PLCE: try { List<Address> addressList =geocoder.getFromLocationName(sta

在我的android应用程序中,我想在地图中搜索距离我当前位置最近的5个地方。这些参数用于设置边界lowerLeftLatitude、lowerLeftLatitude、upperRightLatitude、upperRightLatitude。但我不知道如何设置它们的值

该代码给出了5个PLCE:

            try {
                List<Address> addressList =geocoder.getFromLocationName(staddress, 5);//, lowerLeftLatitude, lowerLeftLongitude, upperRightLatitude, upperRightLongitude;
                    if(adr.getCountryName()!=null)
                    str+=adr.getCountryName().toString();
                }
                Log.v(addressList.toString(),"result");
                editText.setText(addressList.toString());

            } catch (IOException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
试试看{
List addressList=geocoder.getFromLocationName(StatAddress,5);/,lowerLeftLatitude,lowerLeftLatitude,upperRightLatitude,upperRightLatitude;
如果(adr.getCountryName()!=null)
str+=adr.getCountryName().toString();
}
Log.v(addressList.toString(),“result”);
editText.setText(addressList.toString());
}捕获(IOE1异常){
//TODO自动生成的捕捉块
e1.printStackTrace();
}

如何设置距离我所在位置最近的位置的这些值是否有其他方法获取最近的位置?

您可以使用谷歌api根据纬度和经度获取最近的位置。

此google api将根据您传递的查询/参数返回neasrt位置


。这项研究对你很有用

你可以使用谷歌api根据纬度和经度获取最接近的位置。

此google api将根据您传递的查询/参数返回neasrt位置


。这项研究对您很有用

您当前的代码在不指定边界坐标的情况下为您提供了5个最近的地址。那么你还需要什么呢?是的,如果你有5个最近的地址,你还需要什么?更具体一点我想得到一个特定半径内的位置。你当前的代码给出了5个最近的地址,而没有指定边界坐标。那么你还需要什么呢?是的,如果你有5个最近的地址,你还需要什么?更具体一些我想得到在特定半径内的地方谷歌api仍处于试验阶段,我想要更可靠的东西谷歌api仍处于试验阶段,我想要更可靠的东西