2012-10-25 104 views
2

在我的android应用程序中,我想从当前位置的5个最近地点搜索地图。此参数用于设置边界lowerLeftLatitude,lowerLeftLongitude,upperRightLatitude,upperRightLongitude。但我不知道设置它们的值。搜索距离我当前位置最近的地方Android地图

该代码给出了5个plces:

  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(); 
      } 

我如何设置最近的地方,这些价值从我的位置是任何其他方式来获得最近的地方呢?

+0

你目前的代码给你5个最近的地址,没有指定边界坐标。那么你还需要什么? – Sameer

+0

是的,如果你得到5个最近的地址,你还需要什么?更具体一点吧 – Aamirkhan

+0

我想获得特定半径的地方.. – TamiL

回答

4

您可以使用Google API来获取基于经度和纬度的近似位置。 Example

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

Study here。这项研究将对你有用

+0

谷歌API仍处于实验阶段,我想要更可靠的东西 – TamiL

相关问题