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

很實用有趣的功能,容易激發學習興趣。學習

相關文章
相關標籤/搜索