Thursday, December 13, 2007

Google Maps using GWT

There is a nice project which allow to use google maps in GWT,
You can download it from:

http://sourceforge.net/projects/gwt/

This project is really great, hoever The API allow you to convert Location to Lat/Lng coords, but it doesn't allow to convert Lat/Lng coords to Location.

So the solution here is to use SOA, there is a nice WebService which allow you to convert Lat/Lng to Location, it can be download from:

http://www.geonames.org/source-code/

After installing it you can write this code to convert Lat/Lng to Location/Country:

List places = WebService.findNearbyPlaceName(lat, lng);

if (!places.isEmpty()) {
Toponym toponym = (Toponym) places.iterator().next();
String countryName = toponym.getCountryName();
}

No comments:

Links

 
RSS Feeds Submission Directory