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

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

       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");

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

相关文章
相关标签/搜索