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

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

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

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

posted on 2017-06-23 17:04  HBU_DAVID  阅读(304)  评论(0编辑  收藏  举报

导航