Google Groups

Re: Java: How does one get a Point object using getContextByAddress


Michael Nagle Nov 23, 2011 7:23 PM
Posted in group: SimpleGeo Help
Nevermind...got it.

public static void callSimpleGeoContextAsynchronously (final SimpleGeoContextClient client, final String address) throws IOException {
client.getContextByAddress(address, null, new SimpleGeoCallback(){
public void onSuccess(String jsonResponse) {
try {
final JSONObject response = new JSONObject(jsonResponse);
final String queryStr = response.getString("query");
final JSONObject query = new JSONObject(queryStr);
System.out.println("latitude: " + query.getString("latitude"));
System.out.println("longitude: " + query.getString("longitude"));
System.exit(0);
} catch (JSONException e) {
e.printStackTrace();
}
}