我有以下问题: 我写了一个函数来确定作为字符串参数传递一条街的具体位置:地理编码放缓了一切?
private GeoPoint LocationToGeoPointParser(String address) throws IOException
{
Geocoder geoCoder = new Geocoder(this.context,Locale.ENGLISH);
List<Address> addr = null;
addr = geoCoder.getFromLocationName(address, 1);
double la = addr.get(0).getLatitude();
double lo = addr.get(0).getLongitude();
Double longitude = addr.get(0).getLongitude()*1E6;
Double latitude = addr.get(0).getLatitude()*1E6;
return new GeoPoint(latitude.intValue(),longitude.intValue());
//return new GeoPoint(73,32);
}
如果我使用的功能这样,地图加载时一切正常极其缓慢。如果我评论地理编码代码并使用返回新的GeoPoint(73,32),则它正常工作。 有人可以解释为什么地理编码会减慢我的应用程序吗? 谢谢! :)
感谢。它的工作:) – Arkde