I'm trying to use Gmaps4jsf version 3.0.0 in my JSF 2.x application. I want to extract addressess of some places according to global latitude and longitude. To do that I used the following piece of code:
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;
}
However, it didn't work and I encountered the following error:
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)