如果我有城镇或地区的纬度和经度坐标,我如何在Google地图中获取城市名称?
我尝试使用纬度,经度和我有国家,但我不知道如何获得城市名称.
我正在使用适用于Android的Google Place API并使用自动填充功能
一切正常,但是当我得到这里显示的结果时,我没有城市和邮政编码信息.
private ResultCallback<PlaceBuffer> mUpdatePlaceDetailsCallback
= new ResultCallback<PlaceBuffer>() {
@Override
public void onResult(PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
// Request did not complete successfully
Log.e(TAG, "Place query did not complete. Error: " + places.getStatus().toString());
return;
}
// Get the Place object from the buffer.
final Place place = places.get(0);
// Format details of the place for display and show it in a TextView.
mPlaceDetailsText.setText(formatPlaceDetails(getResources(), place.getName(),
place.getId(), place.getAddress(), place.getPhoneNumber(),
place.getWebsiteUri()));
Log.i(TAG, "Place details …Run Code Online (Sandbox Code Playgroud)