这是通过google原生接口获取的经纬度
public static void getGeoPointBystr(Context context,String str) {
Address address_temp = null;
if (str != null) {
Geocoder gc = new Geocoder(context, Locale.CHINA);
List<Address> addressList = null;
try {
addressList = gc.getFromLocationName(str, 1);
if (!addressList.isEmpty()) {
address_temp = addressList.get(0);
double Latitude = address_temp.getLatitude();
double Longitude = address_temp.getLongitude();
}
} catch (IOException e) {
e.printStackTrace();
}
}
Log.d("wwwwww",str+" Latitude = "+Latitude+" Longitude = "+Longitude);
}