【发布时间】:2017-06-14 11:58:20
【问题描述】:
当我使用乌克兰地址点击 Geocode Google API 时,它会为客户端(乌克兰)的某些地址返回 null,但是当我在印度(在我这边)测试它时,它运行良好。
代码:
private LatLng getLocationFromAddress(final String place){
LatLng loc = null;
Geocoder gCoder = new Geocoder(getActivity() );
try {
final List<Address> list = gCoder.getFromLocationName(place, 1);
if (list != null && list.size() > 0) {
loc = new LatLng(list.get(0).getLatitude(), list.get(0).getLongitude());
}
}
catch (IOException e) {
e.printStackTrace();
}
return loc;
}
【问题讨论】:
-
给我看代码,没有代码我们什么都做不了。
标签: java android google-api geocode