0
我想在我的JSF 2.x应用程序中使用Gmaps4jsf版本3.0.0。我想根据全球经纬度提取一些地方的地理位置。要做到这一点我用下面的代码:Gmaps4jsf V3.0.0在尝试反向地理编码时给出HTTP错误
public static String addressGenerator(Double latitude, Double longitude){
String address = "";
try{
address = GMaps4JSFServiceFactory.getReverseGeocoderService().
getPlaceMark(latitude.toString(), longitude.toString()).getAddress();
address = new String(address.getBytes(), "UTF-8");
} catch (Exception e){
e.printStackTrace();
}
return address;
}
但是,它没有工作,我遇到了以下错误:
java.lang.Exception: Error: Server returned HTTP response code: 403 for URL: http://maps.google.com/maps/geo?q=41.13087,28.974647&output=json&sensor=false&key=abcdef
at com.googlecode.gmaps4jsf.services.ReverseGeocoderServiceImpl.getPlaceMark(ReverseGeocoderServiceImpl.java:73)