Android LBS 百度地图(参考: 《第一行代码》第2版(郭霖)11.3.4 显示看得懂的定位信息:准确文字地址)

经纬度不能直接转换为人的准确认知,需要显示文字信息。

       currentPosition.append("地址:").append(location.getAddrStr()).append("
");
            Log.d("map Address",location.getAddrStr()+"");
            currentPosition.append("国家:").append(location.getCountry()).append("
");
            Log.d("map Coutntry",location.getCountry()+"");
            currentPosition.append("省:").append(location.getProvince()).append("
");
            currentPosition.append("市:").append(location.getCity()).append("
");
            currentPosition.append("区:").append(location.getDistrict()).append("
");
            currentPosition.append("街道:").append(location.getStreet()).append("
");

很实用有趣的功能,容易激发学习兴趣。

原文地址:https://www.cnblogs.com/hbuwyg/p/7070834.html