如何从经纬度获取"What's here?"信息?



可以在浏览器的谷歌地图中右键单击并选择"What's here?"结果是街道地址或郊区等。是否有可能在Android谷歌地图API V2中实现类似的功能?将结果作为标题添加到标记上会很酷。由于

基本上是"这里有什么"与特定经纬度相关的返回地址详细信息。因此,你可以使用下面的代码添加结果到InfoWindowAdapter

Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());
addresses = geocoder.getFromLocation(latitude, longitude, 1);
String address = addresses.get(0).getAddressLine(0);
String city = addresses.get(0).getAddressLine(1);
String country = addresses.get(0).getAddressLine(2);

最新更新